1、重启nginx
(1) 找到安装目录的sbin目录下 ./nginx -s reload
(2) 如果没有安装目录sbin systemctl restart nginx
2、做nginx转发时涉及附件上传等传输量比较大的情况需在nginx.conf配置文件中加入
location /ycback/ {
proxy_pass http://10.98.11.4:19020/ycback/; //转发地址
#proxy_redirect off ;
proxy_set_header Host $host:19020; //这里的19020是端口
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 100m;
client_body_buffer_size 256k;
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
proxy_buffer_size 256k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
proxy_max_temp_file_size 128m;
}
3、nginx跳转本地vue项目
location /ycscjg_xzxk_jd/ {
root /usr/share/nginx/html;
try_files $uri $uri/ /ycscjg_xzxk_jd/index.html
index index.html index.htm;
error_page 404 /ycscjg_xzxk_jd/index.html;
}