Advertisement
Guest User

Untitled

a guest
Jan 10th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 4.92 KB | None | 0 0
  1. upstream flask {
  2.             server 127.0.0.1:5005;
  3.     }
  4.  
  5. upstream devkat {
  6.             server 127.0.0.1:1337;
  7.     }
  8.  
  9. server {
  10.             listen       80;
  11.             server_name  example.de www.example.de;
  12.  
  13.     location /.well-known/acme-challenge {
  14.             default_type "text/plain";
  15.             root /var/www/certbot;
  16.     }
  17.  
  18.     # Forces all other requests to HTTPS
  19.     location / {
  20.             return      301 https://$host$request_uri;
  21.     }
  22. }
  23.  
  24. server {
  25.             listen 443 ssl http2;
  26.             server_name example.de www.example.de;
  27.  
  28.             ssl on;
  29.             ssl_certificate /etc/letsencrypt/live/example.de/fullchain.pem;
  30.             ssl_certificate_key /etc/letsencrypt/live/example.de/privkey.pem;
  31.             ssl_protocols TLSv1.2;
  32.             ssl_ciphers 'make-your-own';
  33.             ssl_prefer_server_ciphers on;
  34.             keepalive_timeout 70;
  35.             add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
  36.  
  37.  
  38.         root /var/www/html/Worldopole;
  39.  
  40.        
  41.     location / {
  42. #            rewrite "^/core/(css|js)/(.+)\.(\d{10})\.(css|js)$" /core/$1/$2.$4 last;
  43.             try_files $uri /index.php?$args;
  44.     }
  45.  
  46. location ~* "^/core/(css|js)/(.+)\.(\d{10})\.(css|js)$" {
  47.         alias /var/www/html/Worldopole/core/$1/$2.$4;
  48.         add_header Vary Accept-Encoding;
  49.         expires max;
  50.     }
  51.  
  52.     # nginx configuration
  53.  
  54. #    location /pokemon {
  55. #    rewrite ^/pokemon/(.*)$ /index.php?page=pokemon&id=$1 last;
  56. #
  57. #    }
  58.    
  59.     location = /pokestops {
  60.             rewrite ^(.*)$ /index.php?page=pokestops last;
  61.     }
  62.  
  63.     location = /gym {
  64.             rewrite ^(.*)$ /index.php?page=gym last;
  65.     }
  66.  
  67.     location = /devlog {
  68.             rewrite ^(.*)$ /index.php?page=devlog last;
  69.     }
  70.  
  71.     location = /faq {
  72.             rewrite ^(.*)$ /index.php?page=faq last;
  73.     }
  74.  
  75.     location = /trainer {
  76.             rewrite ^(.*)$ /index.php?page=trainer last;
  77.     }
  78.  
  79.     location = /dashboard {
  80.             rewrite ^(.*)$ /index.php?page=dashboard last;
  81.     }
  82.  
  83.     location = /pokemon {
  84.             rewrite ^(.*)$ /index.php?page=pokedex last;
  85.             rewrite ^(.*)$ /index.php?page=pokedex last;
  86.     }
  87.  
  88.     location = /nests {
  89.             rewrite ^(.*)$ /index.php?page=nests last;
  90.     }
  91.  
  92.     location = /raids {
  93.             rewrite ^(.*)$ /index.php?page=raids last;
  94.     }
  95.  
  96.  
  97.  
  98.     location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ {
  99.            access_log        off;
  100.            expires           max;
  101.          }
  102.  
  103.     location ^~ /go/ {
  104.  
  105.     # Group based Password authentication:
  106.             auth_basic           "Administrator’s area";
  107.             auth_basic_user_file /etc/nginx/allowedusers;
  108.  
  109.             root   /var/www/nginx/html/;
  110.             proxy_pass http://flask/;
  111.         proxy_redirect off;
  112.             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  113.             proxy_set_header X-Forwarded-Proto http;
  114.             proxy_set_header Host $http_host;
  115.     }
  116.  
  117.     location ^~ /pokemon/ {
  118.  
  119.     # Group based Password authentication:
  120. #            auth_basic           "Administrator�~@~Ys area";
  121. #            auth_basic_user_file /etc/nginx/allowedusers;
  122.  
  123.             proxy_pass http://flask;
  124.             proxy_redirect off;
  125.             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  126.             proxy_set_header X-Forwarded-Proto http;
  127.             proxy_set_header Host $http_host;
  128.        
  129.         rewrite ^/pokemon/(.*)$ /index.php?page=pokemon&id=$1 last;
  130.     }
  131.  
  132.     location ~ \.php$ {
  133.  
  134.             include /etc/nginx/fastcgi_params;
  135.             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  136.             fastcgi_param PATH_INFO $fastcgi_path_info;
  137.             fastcgi_split_path_info ^(.+\.php)(/.*)$;
  138.             fastcgi_pass 127.0.0.1:9000;
  139.  
  140.             fastcgi_index index.php;
  141.     }
  142.  
  143.     location /go/raw_data {
  144.             # /stats
  145.             if ($arg_seen = "true") {
  146.                proxy_pass http://flask;
  147.             }
  148.  
  149.             # /status
  150.             if ($arg_status = "true") {
  151.                proxy_pass http://flask;
  152.             }
  153.  
  154.             # Appearances & appearance details.
  155.             if ($arg_appearances = "true") {
  156.                proxy_pass http://flask;
  157.             }
  158.  
  159.             if ($arg_appearancesDetails = "true") {
  160.                proxy_pass http://flask;
  161.             }
  162.  
  163.             # Spawnpoints.
  164.             if ($arg_spawnpoints = "true") {
  165.                proxy_pass http://flask;
  166.             }
  167.  
  168.             # Scanned locations.
  169.             if ($arg_scanned = "true") {
  170.                proxy_pass http://flask;
  171.             }
  172.  
  173.             proxy_pass https://devkat/raw_data;
  174.     }
  175.      
  176.    }
  177.  
  178. server {
  179.         listen 443;
  180.         server_name 123.456.789.230;
  181.         return 301 https://example.de/;
  182. }
  183.  
  184. server {
  185.         listen 80;
  186.         server_name 123.456.789.230;
  187.         return 301 https://example.de/;
  188. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement