Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- if ($host = develop.wikiworks.io) {
- return 301 https://$host$request_uri;
- } # managed by Certbot
- # Server
- listen 80;
- server_name .develop.wikiworks.io;
- if ($scheme = http) {
- return 301 https://$host$request_uri;
- }
- }
- server {
- listen 443 ssl http2;
- # listen 80;
- server_name vireas.develop.wikiworks.io;
- charset utf-8;
- # ssl_certificate /etc/nginx/ssl/wikiworks.crt;
- # ssl_certificate_key /etc/nginx/ssl/wikiworks.key;
- ssl_certificate /etc/letsencrypt/live/stage.wikiworks.io/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/stage.wikiworks.io/privkey.pem;
- error_page 502 @zagl;
- error_page 503 @zagl;
- error_page 302 @zagl;
- location /static-err/
- {
- proxy_pass http://127.0.0.1:9999;
- }
- access_log /var/log/nginx/wikiworks_main_access_log;
- error_log /var/log/nginx/wikiworks_main_error_log;
- if ($scheme = http) {
- return 301 https://$host$request_uri;
- }
- client_max_body_size 6144M;
- client_body_buffer_size 4M;
- proxy_connect_timeout 600;
- proxy_send_timeout 600;
- proxy_read_timeout 600;
- send_timeout 600;
- uwsgi_read_timeout 600;
- location ~ ^/api/v1/ {
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header Host $http_host;
- proxy_redirect off;
- # proxy_pass http://127.0.0.1:8000;
- proxy_pass http://192.168.122.137:8000;
- }
- location ~ ^/download/ {
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header Host $http_host;
- proxy_redirect off;
- # proxy_pass http://127.0.0.1:8000;
- proxy_pass http://192.168.122.137:8000;
- }
- location ~ ^/media/ {
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header Host $http_host;
- proxy_redirect off;
- # proxy_pass http://127.0.0.1:8000;
- proxy_pass http://192.168.122.137:8000;
- }
- location ~ ^/django_query_profiler/ {
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header Host $http_host;
- proxy_redirect off;
- # proxy_pass http://127.0.0.1:8000;
- proxy_pass http://192.168.122.137:8000;
- }
- location ~ ^/landing/ {
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header Host $http_host;
- proxy_redirect off;
- # proxy_pass http://127.0.0.1:8000;
- proxy_pass http://192.168.122.137:8000;
- }
- location /ws/ {
- # proxy_pass http://127.0.0.1:8000;
- proxy_pass http://192.168.122.137:8000;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- }
- location / {
- set $flag 0;
- if (-f /etc/nginx/technical.works ) {
- set $flag 1;
- }
- if ($host = 'www.develop.wikiworks.io' ) {
- set $flag 0;
- }
- if ($host = 'develop.wikiworks.io' ) {
- set $flag 0;
- }
- if ($flag = 1) {
- return 503;
- }
- if ($request_uri ~ technical_works.html)
- {
- set $flag "${flag}1";
- }
- if ($flag = "01")
- {
- rewrite ^ https://$host permanent;
- }
- # proxy_set_header REMOTE_ADDR $proxy_add_x_forwarded_for;
- # proxy_set_header X-Real-IP $proxy_add_x_forwarded_for;
- # proxy_set_header Host $host;
- # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- # proxy_pass http://127.0.0.1:8000;
- root /srv/sites/develop/dist;
- # try_files $uri $uri/index.html;
- index index.html;
- try_files $uri $uri/ /index.html;
- }
- location @zagl {
- # set $fl 0;
- if ($request_uri ~ /static-err/)
- {
- # rewrite ^/static-err/(.*)$ /static/$1 last;
- set $fl 0;
- }
- if ($request_uri ~ technical_works.html)
- {
- set $fl 0;
- }
- if ($fl != 0)
- {
- rewrite ^ https://$host/technical_works.html break;
- }
- proxy_pass http://127.0.0.1:9999;
- }
- }
- server {
- # Server
- listen 443 ssl http2;
- # listen 80;
- server_name develop.wikiworks.io www.develop.wikiworks.io;
- server_name_in_redirect off;
- # ssl_certificate /etc/nginx/ssl/wikiworks.crt;
- # ssl_certificate_key /etc/nginx/ssl/wikiworks.key;
- ssl_certificate /etc/letsencrypt/live/develop.wikiworks.io/fullchain.pem; # managed by Certbot
- ssl_certificate_key /etc/letsencrypt/live/develop.wikiworks.io/privkey.pem; # managed by Certbot
- # root /srv/sites/wp.wikiworks.io/www/wp;
- auth_basic "closed site";
- auth_basic_user_file passwdldap;
- satisfy any;
- allow 127.0.0.1;
- allow 192.168.0.0/16;
- deny all;
- error_page 502 = @zagl;
- error_page 503 = @zagl;
- if ($host = 'www.develop.wikiworks.io') {
- return 301 https://develop.wikiworks.io$request_uri;
- }
- if ($scheme = http) {
- return 301 https://$host$request_uri;
- }
- client_max_body_size 6144M;
- client_body_buffer_size 4M;
- access_log /var/log/nginx/develop.wikiworks_main_access_log;
- error_log /var/log/nginx/develop.wikiworks_main_error_log;
- # Proxy
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-Proto https;
- # location /ru
- # {
- # rewrite /ru/(.*) /$1 break;
- # proxy_set_header X-Real-IP $remote_addr;
- # proxy_set_header Host wikiworks.ru;
- # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- # proxy_pass http://127.0.0.1:8008;
- # }
- location / {
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- # proxy_pass http://127.0.0.1:8009;
- proxy_pass http://192.168.122.137:8080;
- }
- location @zagl {
- proxy_pass http://127.0.0.1:9998;
- }
- }
- server {
- listen 443 ssl http2;
- # listen 80;
- server_name *.develop.wikiworks.io;
- charset utf-8;
- # ssl_certificate /etc/nginx/ssl/wikiworks.crt;
- # ssl_certificate_key /etc/nginx/ssl/wikiworks.key;
- ssl_certificate /etc/letsencrypt/live/stage.wikiworks.io/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/stage.wikiworks.io/privkey.pem;
- error_page 502 @zagl;
- error_page 503 @zagl;
- error_page 302 @zagl;
- location /static-err/
- {
- proxy_pass http://127.0.0.1:9999;
- }
- access_log /var/log/nginx/wikiworks_main_access_log;
- error_log /var/log/nginx/wikiworks_main_error_log;
- if ($scheme = http) {
- return 301 https://$host$request_uri;
- }
- client_max_body_size 6144M;
- client_body_buffer_size 4M;
- proxy_connect_timeout 600;
- proxy_send_timeout 600;
- proxy_read_timeout 600;
- send_timeout 600;
- uwsgi_read_timeout 600;
- location ~ ^/api/v1/ {
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header Host $http_host;
- proxy_redirect off;
- # proxy_pass http://127.0.0.1:8000;
- proxy_pass http://192.168.122.137:8000;
- }
- location ~ ^/download/ {
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header Host $http_host;
- proxy_redirect off;
- # proxy_pass http://127.0.0.1:8000;
- proxy_pass http://192.168.122.137:8000;
- }
- location ~ ^/media/ {
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header Host $http_host;
- proxy_redirect off;
- # proxy_pass http://127.0.0.1:8000;
- proxy_pass http://192.168.122.137:8000;
- }
- location ~ ^/django_query_profiler/ {
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header Host $http_host;
- proxy_redirect off;
- # proxy_pass http://127.0.0.1:8000;
- proxy_pass http://192.168.122.137:8000;
- }
- location ~ ^/landing/ {
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header Host $http_host;
- proxy_redirect off;
- # proxy_pass http://127.0.0.1:8000;
- proxy_pass http://192.168.122.137:8000;
- }
- location /ws/ {
- # proxy_pass http://127.0.0.1:8000;
- proxy_pass http://192.168.122.137:8000;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- }
- location ~ ^/js/ {
- root /srv/sites/stage/dist;
- # try_files $uri $uri/index.html;
- index index.html;
- try_files $uri $uri/ /index.html;
- }
- location / {
- # auth_basic "closed site";
- # auth_basic_user_file passwdldap;
- # satisfy any;
- # allow 127.0.0.1;
- # allow 192.168.0.0/16;
- # deny all;
- set $flag 0;
- if (-f /etc/nginx/technical.works ) {
- set $flag 1;
- }
- if ($host = 'www.develop.wikiworks.io' ) {
- set $flag 0;
- }
- if ($host = 'develop.wikiworks.io' ) {
- set $flag 0;
- }
- if ($flag = 1) {
- return 503;
- }
- if ($request_uri ~ technical_works.html)
- {
- set $flag "${flag}1";
- }
- if ($flag = "01")
- {
- rewrite ^ https://$host permanent;
- }
- # proxy_set_header REMOTE_ADDR $proxy_add_x_forwarded_for;
- # proxy_set_header X-Real-IP $proxy_add_x_forwarded_for;
- # proxy_set_header Host $host;
- # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- # proxy_pass http://127.0.0.1:8000;
- root /srv/sites/develop/dist;
- # try_files $uri $uri/index.html;
- index index.html;
- try_files $uri $uri/ /index.html;
- }
- location @zagl {
- # set $fl 0;
- if ($request_uri ~ /static-err/)
- {
- # rewrite ^/static-err/(.*)$ /static/$1 last;
- set $fl 0;
- }
- if ($request_uri ~ technical_works.html)
- {
- set $fl 0;
- }
- if ($fl != 0)
- {
- rewrite ^ https://$host/technical_works.html break;
- }
- proxy_pass http://127.0.0.1:9999;
- }
- }
- server {
- listen 443 ssl http2;
- # listen 80;
- server_name admin.develop.wikiworks.io;
- charset utf-8;
- # ssl_certificate /etc/nginx/ssl/wikiworks.crt;
- # ssl_certificate_key /etc/nginx/ssl/wikiworks.key;
- ssl_certificate /etc/letsencrypt/live/stage.wikiworks.io/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/stage.wikiworks.io/privkey.pem;
- error_page 502 @zagl;
- error_page 503 @zagl;
- error_page 302 @zagl;
- location /static-err/
- {
- proxy_pass http://127.0.0.1:9999;
- }
- access_log /var/log/nginx/wikiworks_main_access_log;
- error_log /var/log/nginx/wikiworks_main_error_log;
- if ($scheme = http) {
- return 301 https://$host$request_uri;
- }
- client_max_body_size 6144M;
- client_body_buffer_size 4M;
- # Proxy
- # proxy_set_header REMOTE_ADDR $remote_addr;
- # proxy_set_header X-Real-IP $proxy_add_x_forwarded_for;
- # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- # proxy_set_header Host $host;
- proxy_connect_timeout 600;
- proxy_send_timeout 600;
- proxy_read_timeout 600;
- send_timeout 600;
- uwsgi_read_timeout 600;
- location /landing
- {
- # auth_basic "Unauthorized";
- # auth_basic_user_file /etc/nginx/htpasswd;
- # satisfy any;
- # allow 192.168.0.0/16;
- # allow 172.16.0.0/12;
- # allow 127.0.0.0/8;
- # allow 5.166.101.190;
- proxy_set_header REMOTE_ADDR $proxy_add_x_forwarded_for;
- proxy_set_header X-Real-IP $proxy_add_x_forwarded_for;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- # proxy_pass http://127.0.0.1:8000;
- proxy_pass http://192.168.122.137:8000;
- }
- location ~ ^/django_query_profiler/ {
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header Host $http_host;
- proxy_redirect off;
- # proxy_pass http://127.0.0.1:8000;
- proxy_pass http://192.168.122.137:8000;
- }
- location / {
- set $flag 0;
- if (-f /etc/nginx/technical.works ) {
- set $flag 1;
- }
- if ($host = 'www.develop.wikiworks.io' ) {
- set $flag 0;
- }
- if ($host = 'develop.wikiworks.io' ) {
- set $flag 0;
- }
- if ($flag = 1) {
- return 503;
- }
- if ($request_uri ~ technical_works.html)
- {
- set $flag "${flag}1";
- }
- if ($flag = "01")
- {
- rewrite ^ https://$host permanent;
- }
- # proxy_cache all;
- # proxy_cache_valid any 1h;
- proxy_set_header REMOTE_ADDR $proxy_add_x_forwarded_for;
- proxy_set_header X-Real-IP $proxy_add_x_forwarded_for;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- # proxy_pass http://127.0.0.1:8000;
- proxy_pass http://192.168.122.137:8000;
- }
- location @zagl {
- # set $fl 0;
- if ($request_uri ~ /static-err/)
- {
- # rewrite ^/static-err/(.*)$ /static/$1 last;
- set $fl 0;
- }
- if ($request_uri ~ technical_works.html)
- {
- set $fl 0;
- }
- if ($fl != 0)
- {
- rewrite ^ https://$host/technical_works.html break;
- }
- proxy_pass http://127.0.0.1:9999;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement