1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-09 00:00:01 +01:00
VILLASweb/nginx.default.conf

41 lines
1.2 KiB
Text
Raw Permalink Normal View History

2015-10-24 13:23:45 +02:00
server {
listen 80 default_server;
server_name labmashup;
# proxy for orion context broker
2015-10-24 14:05:14 +00:00
location /api/ {
2015-10-24 13:23:45 +02:00
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
if ($request_method = 'OPTIONS') {
add_header Access-Control-Allow-Origin '$http_origin' always;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS, PUT, DELETE' always;
add_header Access-Control-Allow-Credentials 'true' always;
add_header Access-Control-Allow-Headers 'Origin,Content-Type,Accept' always;
add_header Content-Length 0;
add_header Content-Type text/plain;
return 204;
}
# rewrite url to exclude /api on context broker side
rewrite ^/api/?(.*) /$1 break;
add_header Access-Control-Allow-Origin '*' always;
add_header Access-Control-Allow-Credentials 'true' always;
2015-10-24 14:05:14 +00:00
proxy_pass http://orion:1026/;
}
2015-10-24 13:23:45 +02:00
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}