例子
- 进入配置目录
cd /etc/nginx/sites-enabled
- 新建文件 xiu66.site,内容如下:
server {
listen 80;
server_name xiu66.site;
client_max_body_size 20m;
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://127.0.0.1:3000;
}
location /static/ {
root /web/xiu66/dist/;
index index.html;
}
}
URL 匹配规则
- https://www.jianshu.com/p/38810b49bc29
- http://nginx.org/en/docs/http/ngx_http_core_module.html
配置 https
参考 https://coolshell.cn/articles/18094.html