12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- map $http_origin $cors_header{
- default "";
- include /etc/nginx/sites-whitelist/jsonapi.map;
- }
- server {
- listen 80;
- listen [::]:80;
- access_log /var/log/nginx/teetopia.access.log;
- error_log /var/log/nginx/teetopia.error.log;
- server_name teetopia teetopia.eyeofmidas.net;
- #server_name jsonapi.eyeofmidas.net;
- #return 302 https://$server_name$request_uri;
- location / {
- #include snippets/disable-cors.conf;
- if ($request_method = 'OPTIONS') {
- add_header 'Access-Control-Allow-Origin' '$cors_header';
- add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
- add_header 'Access-Control-Max-Age' 1728000;
- add_header 'Content-Type' 'text/plain; charset=utf-8';
- add_header 'Content-Length' 0;
- return 204;
- }
- proxy_pass http://127.0.0.1:38872;
- proxy_hide_header Access-Control-Allow-Origin;
- add_header 'Access-Control-Allow-Origin' "$cors_header" always;
- add_header 'Access-Control-Allow-Credentials' 'true' always;
- add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, X-Auth-Token';
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection $http_connection;
- }
- location /ws {
- proxy_pass http://127.0.0.1:38872;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "Upgrade";
- proxy_set_header Host $host;
- }
- }
- server {
- listen 443 ssl http2;
- listen [::]:443 ssl http2;
- include snippets/self-signed.conf;
- access_log /var/log/nginx/teetopia.access.log;
- error_log /var/log/nginx/teetopia.error.log;
- server_name teetopia teetopia.eyeofmidas.net;
- location / {
- #include snippets/disable-cors.conf;
- if ($request_method = 'OPTIONS') {
- add_header 'Access-Control-Allow-Origin' '$cors_header';
- add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
- add_header 'Access-Control-Max-Age' 1728000;
- add_header 'Content-Type' 'text/plain; charset=utf-8';
- add_header 'Content-Length' 0;
- return 204;
- }
- proxy_pass http://127.0.0.1:38872;
- proxy_hide_header Access-Control-Allow-Origin;
- add_header 'Access-Control-Allow-Origin' "$cors_header" always;
- add_header 'Access-Control-Allow-Credentials' 'true' always;
- add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, X-Auth-Token';
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection $http_connection;
- }
- location /ws {
- proxy_pass http://127.0.0.1:38872;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "Upgrade";
- proxy_set_header Host $host;
- }
- }
|