diff options
author | sijanec <sijanecantonluka@gmail.com> | 2020-09-26 21:42:10 +0200 |
---|---|---|
committer | sijanec <sijanecantonluka@gmail.com> | 2020-09-26 21:42:10 +0200 |
commit | 3a3246dfecab404df90513989bf84a270e17d1f1 (patch) | |
tree | 629eb2d4f82d561fa709150742bb64c0bef54759 /server/proxy/lopolis.conf | |
parent | unset tracking vars are now not reported to the spyware server (diff) | |
download | beziapp-3a3246dfecab404df90513989bf84a270e17d1f1.tar beziapp-3a3246dfecab404df90513989bf84a270e17d1f1.tar.gz beziapp-3a3246dfecab404df90513989bf84a270e17d1f1.tar.bz2 beziapp-3a3246dfecab404df90513989bf84a270e17d1f1.tar.lz beziapp-3a3246dfecab404df90513989bf84a270e17d1f1.tar.xz beziapp-3a3246dfecab404df90513989bf84a270e17d1f1.tar.zst beziapp-3a3246dfecab404df90513989bf84a270e17d1f1.zip |
Diffstat (limited to '')
-rw-r--r-- | server/proxy/lopolis.conf | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/server/proxy/lopolis.conf b/server/proxy/lopolis.conf new file mode 100644 index 0000000..66f2d94 --- /dev/null +++ b/server/proxy/lopolis.conf @@ -0,0 +1,55 @@ +# /etc/nginx/sites-enabled/lopolis +server { + listen 0.0.0.0:80; + listen [::]:80; + server_name .lopolis.gimb.tk; + return 301 https://lopolis.gimb.tk/; +} +server { + listen 0.0.0.0:443 http2 ssl; + listen [::]:443 http2 ssl; + ssl_certificate /etc/ssl/sslforfree/gimb.tk.crtca; + ssl_certificate_key /etc/ssl/sslforfree/gimb.tk.key; + server_name .lopolis.gimb.tk; + location / { + if ($http_origin ~ \.?gimb\.tk$) { + set $cors 'true'; + set $both_conditions "P"; + add_header "x-debug-http-origin-check" "passed"; + } + if ($http_origin ~ \.?beziapp\.github\.io$) { + set $cors 'true'; + set $both_conditions "P"; + add_header "x-debug-http-origin-check" "passed"; + } + if ($cors = 'true') { + add_header "Access-Control-Allow-Origin" $http_origin always; + add_header "Access-Control-Allow-Credentials" "true" always; + add_header "Access-Control-Allow-Methods" "GET, POST, PATCH, PUT, DELETE, OPTIONS" always; + add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With,Authorization' always; + add_header 'Access-Control-Expose-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With,Authorization' always; + } + if ($request_method = 'OPTIONS') { + set $both_conditions "${both_conditions}D"; + } + if ($both_conditions = PD) { + add_header "Access-Control-Allow-Origin" $http_origin always; + add_header "Access-Control-Allow-Credentials" "true" always; + add_header "Access-Control-Allow-Methods" "GET, POST, PATCH, PUT, DELETE, OPTIONS" always; + add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With,Authorization' always; + add_header 'Access-Control-Expose-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With,Authorization' always; + add_header 'Access-Control-Max-Age' -1; + add_header 'Content-Type' 'text/plain charset=UTF-8'; + add_header 'Content-Length' 0; + return 204; + } + access_log /var/log/nginx/lopolis/access.log postdata; + proxy_set_header Host www.lopolis.si; + proxy_set_header X-Real-IP $remote_addr; + proxy_redirect off; + proxy_ssl_server_name on; + proxy_pass https://www.lopolis.si; + # try_files $uri $uri/ =404; + } +} + |