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;

}

}

}


本文标签: 地址 网页 配置 注册 免费