admin 管理员组文章数量: 887021
2024年1月17日发(作者:免费注册网页)
nginx配置实例
worker_processes 1;
events {
worker_connections 1024;
}
http {
include ;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
fastcgi_buffers 8 128k;
upstream http_backend {
}
server {
server 127.0.0.1:80;
server 192.168.1.36:80; //电脑本地的地址及端口
keepalive 16;
listen 80; //监听的端口
keepalive_timeout 300;
server_name 192.168.1.36; //监听的地址
location / {
proxy_pass 192.168.1.36:8080/; //要跳转的目标地址
}
location /项目名/images/ {
alias /nginx/web/项目名/images/;
}
location /项目名/file/ {
alias /nginx/web/项目名/file/;
}
location /项目名/css/ {
alias /nginx/web/项目名/css/;
}
location /项目名/js/ {
alias /nginx/web/项目名/js/;
}
location /项目名/chat/ {
}
location ~* .(jsp|page|do)?$ {
proxy_pass http_backend;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass 192.168.1.36:8080;
}
error_page 500 502 503 504 /;
location = / {
root html;
}
}
server{
listen 80;
server_name localhost;
location / {
proxy_pass 192.168.1.36:8080/abcd/;
}
error_page 500 502 503 504 /;
location = / {
root html;
}
}
}
版权声明:本文标题:nginx反向代理配置实例 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/jishu/1705452741h485340.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论