53 lines
1.7 KiB
Plaintext
53 lines
1.7 KiB
Plaintext
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name localhost;
|
|
|
|
location /omc-api/ {
|
|
proxy_pass http://127.0.0.1:33030/;
|
|
|
|
proxy_cache_bypass $http_upgrade;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
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 X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
}
|
|
|
|
location /api/rest/ {
|
|
# 添加斜杠并重定向
|
|
#rewrite ^([^.]*[^/])$ $1/ permanent;
|
|
proxy_pass http://127.0.0.1:33030/nms-cxy/api/rest/;
|
|
|
|
proxy_cache_bypass $http_upgrade;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
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 X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
}
|
|
|
|
location / {
|
|
root /usr/local/omc/htdocs/front;
|
|
|
|
try_files $uri $uri/ /index.html;
|
|
index index.html index.htm;
|
|
}
|
|
|
|
#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;
|
|
}
|
|
}
|
|
|