更新 nginx-route.conf
This commit is contained in:
parent
4b926d8c0b
commit
75ae895714
43
nginx-route.conf
Normal file
43
nginx-route.conf
Normal file
@ -0,0 +1,43 @@
|
||||
user root;
|
||||
worker_processes 1;
|
||||
error_log /var/log/nginx/error.log;
|
||||
pid /run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name jkwlstv.cn;
|
||||
charset utf-8;
|
||||
|
||||
# 301永久重定向规则
|
||||
location /git { return 301 http://jkwlstv.cn:8418; }
|
||||
location /nas { return 301 http://jkwlstv.cn:5000; }
|
||||
location /sql { return 301 http://jkwlstv.cn:12222; }
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
try_files $uri $uri/ @router;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
location @router {
|
||||
rewrite ^.*$ /index.html last;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,66 +0,0 @@
|
||||
user root;
|
||||
worker_processes 1;
|
||||
error_log /var/log/nginx/error.log;
|
||||
pid /run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name jkwlstv.cn;
|
||||
charset utf-8;
|
||||
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
try_files $uri $uri/ @router;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
location @router {
|
||||
rewrite ^.*$ /index.html last;
|
||||
}
|
||||
|
||||
location ^~ /git {
|
||||
proxy_pass http://jkwlstv.cn:8418/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header REMOTE-HOST $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
|
||||
}
|
||||
|
||||
location ^~ /nas {
|
||||
proxy_pass http://jkwlstv.cn:5000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header REMOTE-HOST $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
|
||||
}
|
||||
|
||||
location ^~ /sql {
|
||||
proxy_pass http://jkwlstv.cn:12222;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header REMOTE-HOST $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user