76 lines
2.8 KiB
Plaintext
76 lines
2.8 KiB
Plaintext
map $http_upgrade $connection_upgrade {
|
|
default upgrade;
|
|
'' close;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
#root /usr/share/nginx/html;
|
|
#index index.html index.htm;
|
|
|
|
add_header 'Access-Control-Allow-Origin' '*' always;
|
|
add_header 'Access-Control-Allow_Credentials' 'true' always;
|
|
add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range' always;
|
|
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH' always;
|
|
add_header X-Frame-Options SAMEORIGIN;
|
|
location / {
|
|
proxy_pass http://localhost:8080/basicui/app/;
|
|
proxy_set_header Host $http_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 Upgrade $http_upgrade;
|
|
proxy_set_header Connection "Upgrade";
|
|
proxy_read_timeout 3600;
|
|
}
|
|
|
|
location /mdl {
|
|
proxy_pass http://localhost:8080/basicui/mdl;
|
|
}
|
|
location /roboto.css {
|
|
proxy_pass http://localhost:8080/basicui/roboto.css;
|
|
}
|
|
location /material-icons.css {
|
|
proxy_pass http://localhost:8080/basicui/material-icons.css;
|
|
}
|
|
location /smarthome.css {
|
|
proxy_pass http://localhost:8080/basicui/smarthome.css;
|
|
}
|
|
location /smarthome.js {
|
|
proxy_pass http://localhost:8080/basicui/smarthome.js;
|
|
}
|
|
location /icon {
|
|
proxy_pass http://localhost:8080/icon;
|
|
}
|
|
location /rest {
|
|
proxy_pass http://localhost:8080/rest;
|
|
proxy_set_header Host $http_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 Upgrade $http_upgrade;
|
|
proxy_set_header Connection "Upgrade";
|
|
}
|
|
location /fonts {
|
|
proxy_pass http://localhost:8080/basicui/fonts;
|
|
}
|
|
location /images {
|
|
proxy_pass http://localhost:8080/basicui/images;
|
|
}
|
|
|
|
location /grafana/ {
|
|
proxy_pass http://localhost:3000/;
|
|
proxy_set_header Host $host;
|
|
}
|
|
|
|
# Proxy Grafana Live WebSocket connections.
|
|
location /grafana/api/live {
|
|
rewrite ^/grafana/(.*) /$1 break;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
proxy_set_header Host $http_host;
|
|
proxy_pass http://localhost:3000/;
|
|
}
|
|
}
|