Advertisement
Guest User

config

a guest
Apr 11th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 3.26 KB | None | 0 0
  1. upstream pogomap {
  2.    server localhost:3331;
  3.    server localhost:3332;
  4.    server localhost:3333;
  5.    server localhost:3334;
  6.    server localhost:3335;
  7.    server localhost:3336;
  8.    server localhost:3337;
  9.    server localhost:3338;
  10. }
  11.  
  12.  
  13. server {
  14.     listen 80;
  15.         server_name  mysite.com; www.mysite.com
  16.         location /.well-known/acme_challenge {
  17.         default_type "text/plain";
  18.         root /var/www/certbot;
  19.     }
  20.  
  21.     # Forces all other requests to HTTPS
  22.     location / {
  23.         return      301 https://$host$request_uri;
  24.     }
  25. }
  26.  
  27. server {
  28.     listen 443 ssl http2;
  29.     server_name mysite.com www.mysite.com;
  30.     ssl_certificate /etc/letsencrypt/live/mysite.com/fullchain.pem;
  31.     ssl_certificate_key /etc/letsencrypt/live/mysite.com/privkey.pem;
  32.     add_header X-Cache-Status $upstream_cache_status;
  33.     root /var/www/html;
  34.     index index.php index.html index.htm;
  35.     #access_log  /var/log/nginx/www.access.log
  36.     #error_log   /var/log/nginx/www.error.log;
  37.     rewrite_log on;
  38.     log_not_found off;
  39.     charset UTF-8;
  40.  
  41.         #specific pokemon vs all pokemon
  42.         rewrite ^/pokemon/(.+)$ /index.php?page=pokemon&id=$1 break;
  43.         rewrite ^/pokemon/?$    /index.php?page=pokedex       break;
  44.  
  45.         #page rewrites
  46.         rewrite ^/(pokestops|gym|dashboard|devlog|faq|trainer|nests)$ /index.php?page=$1$
  47.  
  48.         #static files
  49.         rewrite "^/core/(css|js)/(.+)\.(\d{10})\.(css|js)$" /core/$1/$2.$4 break;
  50.  
  51.         client_header_buffer_size 4k;
  52.         client_max_body_size 2047M;
  53.         client_body_buffer_size 128k;
  54.         client_body_temp_path /tmp 1 2;
  55.  
  56.         ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  57.         ssl_prefer_server_ciphers on;
  58.         ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA$
  59.  
  60.        ssl_session_cache shared:ssl_session_cache:10m;
  61.  
  62. ##Disable viewing .htaccess & .htpassword
  63.      location ~ /\.ht {
  64.                deny  all;
  65.                return 404;
  66.        }
  67.  
  68.  
  69.      location ~ /.well-known {
  70.                allow all;
  71.        }
  72.  
  73.       location /nginx_status {
  74.        # Turn on stats
  75.        stub_status on;
  76.        access_log   off;
  77.        }
  78.  
  79.        location ~ .php$ {
  80.             fastcgi_split_path_info ^(.+\.php)(.*)$;
  81.             fastcgi_pass   unix:/run/php/php7.0-fpm.sock;
  82.             fastcgi_index  index.php;
  83.             fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
  84.             include fastcgi_params;
  85.             fastcgi_param  QUERY_STRING     $query_string;
  86.             fastcgi_param  REQUEST_METHOD   $request_method;
  87.             fastcgi_param  CONTENT_TYPE     $content_type;
  88.             fastcgi_param  CONTENT_LENGTH   $content_length;
  89.             fastcgi_intercept_errors        off;
  90.             fastcgi_ignore_client_abort     off;
  91.             fastcgi_connect_timeout 60;
  92.             fastcgi_send_timeout 180;
  93.             fastcgi_read_timeout 180;
  94.             fastcgi_buffering on;
  95.             fastcgi_max_temp_file_size 0;
  96.    }
  97.  
  98.    location /bkkth/ {
  99.       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  100.       proxy_set_header X-Forwarded-Proto http;
  101.       proxy_set_header Host $http_host;
  102.       proxy_redirect off;
  103.       proxy_pass http://pogomap/;
  104.  
  105.    }
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement