nginx基本操作命令和配置
程序员文章站
2022-06-10 14:54:33
nginx基本操作命令:启动nginx服务:start nginx停止nginx服务:nginx -s stop重启服务(修改配置生效的方式):nginx -s reload检查配置: nginx -t反向代理配置:location ^~ /login/ { proxy_pass http://ip:8080/gwmro/mobileService/login/; proxy_set_header Host $host;...
nginx基本操作命令:
启动nginx服务:start nginx
停止nginx服务:nginx -s stop
重启服务(修改配置生效的方式):nginx -s reload
检查配置: nginx -t
反向代理配置:
location ^~ /login/ {
proxy_pass http://ip:8080/gwmro/mobileService/login/;
proxy_set_header Host $host;
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;
proxy_set_header X-Forwarded-Proto $scheme;
}
gzip压缩配置:
gzip on;
gzip_static on;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_proxied any;
gzip_vary on;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
总结
每天记录一点,从小小菜鸟变小菜鸟!!!本文地址:https://blog.csdn.net/King0217/article/details/111866139
下一篇: Fireworks制作超酷质感按钮