diff options
Diffstat (limited to 'conf/nginx')
-rw-r--r-- | conf/nginx/nginx.conf | 72 | ||||
-rw-r--r-- | conf/nginx/site.conf | 72 |
2 files changed, 72 insertions, 72 deletions
diff --git a/conf/nginx/nginx.conf b/conf/nginx/nginx.conf new file mode 100644 index 0000000..64f1b1d --- /dev/null +++ b/conf/nginx/nginx.conf @@ -0,0 +1,72 @@ +worker_processes 4; +daemon off; +pid /tmp/nginx.pid; +error_log /var/log/nginx/error.log; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 70; + server_tokens off; + client_max_body_size 2m; + + access_log /var/log/nginx/access.log; + + upstream postgrest { + server rest:3000; + } + + server { + listen 8080; + root /opt/xssbook; + + gzip on; + gzip_vary on; + gzip_proxied any; + gzip_comp_level 6; + gzip_buffers 16 8k; + gzip_http_version 1.1; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml image/x-icon; + + location /api/ { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_set_header Accept-Encoding ""; + proxy_redirect off; + + default_type application/json; + add_header 'Access-Control-Allow-Origin' '*'; + add_header Content-Location /api/$upstream_http_content_location; + proxy_set_header Connection ""; + proxy_http_version 1.1; + + proxy_pass http://postgrest/; + } + + location /favicon.ico { + add_header 'Access-Control-Allow-Origin' '*'; + root /opt/xssbook/public; + add_header Cache-Control "public, max-age=108000"; + } + + location /public { + add_header 'Access-Control-Allow-Origin' '*'; + try_files $uri =404; + add_header Cache-Control "public, max-age=108000"; + } + + location / { + add_header 'Access-Control-Allow-Origin' '*'; + root /opt/xssbook/web; + include fastcgi_params; + fastcgi_pass php:9000; + fastcgi_param SCRIPT_FILENAME $document_root/index.php; + } + + } +} diff --git a/conf/nginx/site.conf b/conf/nginx/site.conf deleted file mode 100644 index 04c75ca..0000000 --- a/conf/nginx/site.conf +++ /dev/null @@ -1,72 +0,0 @@ -server_tokens off; - -upstream postgrest { - server rest:3000 fail_timeout=0; -} - -upstream swagger { - server swagger:3000 fail_timeout=0; -} - -server { - listen 80; - server_name localhost; - - keepalive_timeout 70; - sendfile on; - client_max_body_size 2m; - - error_log /var/log/nginx/error.log; - access_log /var/log/nginx/access.log; - - root /opt/xssbook; - - gzip on; - gzip_vary on; - gzip_proxied any; - gzip_comp_level 6; - gzip_buffers 16 8k; - gzip_http_version 1.1; - gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml image/x-icon; - - location /api/ { - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Host $http_host; - proxy_set_header Accept-Encoding ""; - proxy_redirect off; - - default_type application/json; - add_header 'Access-Control-Allow-Origin' '*'; - add_header Content-Location /api/$upstream_http_content_location; - proxy_set_header Connection ""; - proxy_http_version 1.1; - proxy_pass http://postgrest/; - } - - location /apidocs { - add_header 'Access-Control-Allow-Origin' '*'; - proxy_http_version 1.1; - proxy_pass http://swagger; - } - - location /favicon.ico { - add_header 'Access-Control-Allow-Origin' '*'; - root /opt/xssbook/public; - add_header Cache-Control "public, max-age=108000"; - } - - location /public { - add_header 'Access-Control-Allow-Origin' '*'; - try_files $uri =404; - add_header Cache-Control "public, max-age=108000"; - } - - location / { - add_header 'Access-Control-Allow-Origin' '*'; - root /opt/xssbook/web; - include fastcgi_params; - fastcgi_pass php:9000; - fastcgi_param SCRIPT_FILENAME $document_root/index.php; - } - -} |