中文说明文档
https://docshome.gitbook.io/nginx-docs/readme/chu-xue-zhe-zhi-nan
重新加载配置文件 -c 指定自定义配置文件
nginx -s reload
验证默认配置文件
nginx -t
验证自定义配置文件
nginx -t -c /home/test/conf/nginx.conf
upstream xckefu {server 111.229.106.32:8080;}server {listen 80;server_name localhost;location /xckefu {proxy_pass http://xckefu;# 这三行解决,当请求被srping 拦截器拦截后,通过request拿到的server是代理地址 xckefu,而不是实际请求地址的问题proxy_redirect off;proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;}location /abc {root /usr/share/nginx/html/dist;#root这里填了容器中的绝对路径 请求的是 /usr/share/nginx/html/dist/abc/index.html#我填相对路径如html/dist时#容器会去/etc/nginx/html/dist/abc找 index.htmlindex index.html index.htm;}}
