nginx代理示例 发表于 2022-01-20 | 更新于: 2022-03-31 | 分类于 Linux | 次阅读 字数统计: 179 | 阅读时长 ≈ 1 1 示例1 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556server { listen 80; listen [::]:80; server_name localhost; #access_log /var/log/nginx/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.htm; }# 多本地路径代理 location /test { alias /test; } location /admin { alias /admin; }# 反向代理 location /landBlockOpt/ { proxy_pass http://192.168.0.91:85/landBlockOpt/; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #}} -------------本文结束感谢您的阅读------------- 本文标题:nginx代理示例 文章作者:OperationMAN 发布时间:2022年01月20日 - 16:01 最后更新:2022年03月31日 - 16:03 原始链接:https://kxinter.gitee.io/2022/01/20/nginx代理示例/ 许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。 坚持原创技术分享,您的支持将鼓励我继续创作! 打赏 微信支付 支付宝