1. 查看nginx所在位置

$ nginx -t
/etc/nginx/nginx.conf

2. 配置

user  nobody; #启动服务的用户
worker_processes  2;

error_log  logs/error.log; #错误日志

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

    gzip    on;
    gzip_min_length 1k;
    gzip_buffers    4 8k;
    gzip_http_version   1.1;
    gzip_types  text/plain application/x-javascript text/css application/xml;

    server {
        listen 80;
        server_name *.sapphirecastle.win; #域名
        root ~/website/SapphireCastle/;
        location / {
            index index.html index.htm;
            proxy_pass http://localhost:3000; #代理端口
        }
    }
}

相关文章:

  • 2021-12-26
  • 2021-11-27
  • 2021-05-21
  • 2021-12-26
猜你喜欢
  • 2021-09-26
  • 2021-12-26
  • 2022-12-23
  • 2022-01-16
  • 2022-12-23
  • 2022-01-07
  • 2021-12-26
相关资源
相似解决方案