安裝
https://blog.csdn.net/qq_42815754/article/details/82980326
https://blog.csdn.net/qq_42815754/article/details/82980326
命令
/usr/local/nginx/sbin/nginx
/usr/local/nginx/sbin/nginx -s reload
/usr/local/nginx/sbin/nginx -s stop
/usr/local/nginx/sbin/nginx -t
配置文件
/usr/local/nginx/conf/nginx.conf
https://blog.csdn.net/weixin_30361753/article/details/96561369
https://blog.csdn.net/fatedant/article/details/82182057
sticky安裝
https://www.cnblogs.com/tssc/p/7481885.html
[emerg]: getpwnam(“nginx”) failed
https://www.cnblogs.com/love3556/p/5962388.html
underscores_in_headers on; #如果你的ajax有請求頭,並且帶_,那麼應該是on,否則頭會被忽略
upstream cgsSamp {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name localhost;
server_name_in_redirect off;
proxy_set_header Host $host:$server_port;
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;
#charset koi8-r;
#access_log logs/host.access.log main;
#location aaa {
#location / {
# root /var/www/html;
# index index.html;
#}
location /cgsSamp {
proxy_pass http://cgsSamp/;
}
location / {
proxy_pass http://cgsSamp/; #這裏最後是有一個/的
}
}