Advertisement
Guest User

Untitled

a guest
Jul 18th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 10.91 KB | None | 0 0
  1. server {
  2.  
  3.     listen 5.45.72.16:80;
  4. #   listen 5.45.72.16:443 ssl;
  5.  
  6.     server_name ~^www\.(.*)$;
  7.     return 301 $scheme://$1$request_uri;
  8.  
  9. }
  10.  
  11. server {
  12.  
  13. #        listen 5.45.72.16:80;
  14.  
  15.         listen 5.45.77.183:80;
  16.  
  17.         #listen 5.45.72.16:443 ssl;
  18.  
  19.         server_name ya888ya.net ya-888-ya.com;
  20.  
  21.         charset UTF-8;
  22.         disable_symlinks if_not_owner from=$root_path;
  23.         index index.html index.php;
  24.         root $root_path;
  25.  
  26.         set $root_path /var/www/ya8/data/www/ya888ya.org;
  27.         ssi on;
  28.  
  29.         access_log /var/www/httpd-logs/ya888ya.org.access.log;
  30.         error_log /var/www/httpd-logs/ya888ya.org.error.log notice;
  31.  
  32.         #*** Lock request by user agent
  33. #        if ($http_user_agent = "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36" ) {
  34. #           return 403;
  35. #        }
  36.  
  37.  
  38.        location / {
  39.        
  40.  
  41. #Блокировка город/страна - файл geomap.conf
  42.  
  43.         if ($allowed_country = no) {
  44.             return 403;
  45.         }
  46.  
  47.         if ($allowed_city = no) {
  48.             return 403;
  49.         }
  50.  
  51. #Открытие доступа игрокам из Крыма
  52.  
  53.         if ($crimea_city = yes) {
  54.           set $geoip2_data_country_code RU;
  55.         }
  56.  
  57.  
  58.                 # First attempt to serve request as file, then
  59.                 # as directory, then fall back to index.html
  60.  
  61.                 #rewrite ^/(games/slots)$ / redirect;
  62.  
  63.                 #try_files $uri $uri/ /index.html;
  64.                 expires off;
  65.  
  66. #               try_files $uri $uri/ @kohana;
  67.                 try_files $uri /index.php?$query_string;
  68.  
  69. #       add_header CFF_COUNTRY "$geoip2_data_country_code";
  70.  
  71.                 #504 error recovering
  72.                 proxy_read_timeout 300;
  73.  
  74.                 # Uncomment to enable naxsi on this location
  75.                # include /etc/nginx/naxsi.rules
  76.         }
  77.  
  78.  
  79. location /country
  80.         {
  81. #         default_type text/html;
  82.          #   default_type application/vnd.maxmind.com-country+json;
  83.          #   add_header X-uri "$geoip2_data_country_code";
  84.          #   add_header X-uri "$geoip2_data_country_code";
  85.          add_header CF_COUNTRY "$geoip2_data_country_code";
  86. #         add_header CF_CITY "$geoip2_data_city_name";
  87.          return 200 "$geoip2_data_country_code";
  88. #        return 200 "$geoip2_data_city_name";
  89.         }
  90.  
  91.  
  92.  
  93.       #подгрузка картинок из seo.orionlab.ru на проекты со скрытием домена
  94.  
  95.         location ^~ /uploads {
  96.         try_files $uri $uri/ /seo_uploads$uri;
  97.         }
  98.  
  99.     location ^~ /seo_uploads {
  100.  
  101.                 proxy_pass http://seo.orionlab.ru/;
  102.                 proxy_redirect http://seo.orionlab.ru/ /;
  103.  
  104.     }
  105.  
  106.  
  107.     location /data.json {
  108.         rewrite ^(.*)$ /media/lobby/data.json redirect;
  109.     }
  110.  
  111.     location /windows.swf {
  112.         rewrite ^(.*)$ /media/lobby/windows.swf redirect;
  113.     }
  114.  
  115.     location /lobby.swf {
  116.         rewrite ^(.*)$ /media/lobby/lobby.swf redirect;
  117.     }
  118.  
  119.     location /menu.swf {
  120.  
  121.         rewrite ^(.*)$ /media/lobby/menu.swf redirect;
  122.  
  123.     }
  124.  
  125.     location /player/logout.json {
  126.         rewrite ^(.*)$ /media/lobby/player/logout.json redirect;
  127.     }
  128.  
  129.    location @kohana {
  130.         rewrite ^/(.+)$ /index.php$request_uri last;
  131.     }
  132.  
  133.     # Don't log robots.txt or favicon.ico files
  134.     location = /favicon.ico { log_not_found off; access_log off; }
  135.  
  136.   location = /robots.txt  {
  137.  
  138. #       rewrite ^(.*)$ /index.php/$0 break;
  139.         access_log off;
  140.         log_not_found off;
  141.         try_files $uri @kohana;
  142.  
  143.    }
  144.  
  145.     # 404 errors handled by our application, for instance Laravel or CodeIgniter
  146.     error_page 404 /index.php;
  147.  
  148. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  149.     location ~ \.php$ {
  150.             try_files $uri $uri/ @kohana;
  151.             #fastcgi_pass unix:/var/run/php5-fpm.sock;
  152.             fastcgi_pass 127.0.0.1:9000;
  153.             #fastcgi_split_path_info ^(.+\.php)(/.+)$;
  154.             # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  155.             include fastcgi_params;
  156. # added for kohana
  157.             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  158.  
  159. #Симуляция передачи заголовка Geoip от Cloudflare
  160.  
  161.             fastcgi_param HTTP_CF_IPCOUNTRY "$geoip2_data_country_code";
  162.  
  163.             fastcgi_param  KOHANA_ENV production;
  164.  
  165.             fastcgi_cache off;
  166. #504 error recovering
  167.             fastcgi_read_timeout 180;
  168.  
  169.             # With php5-cgi alone:
  170.             # fastcgi_pass 127.0.0.1:9000;
  171.             # With php5-fpm:
  172.             fastcgi_index index.php;
  173.     }
  174.  
  175.          # Deny access to files starting with dot (.htaccess, .svn, etc)
  176.          location  ~ /\. {
  177.              deny all;
  178.          }
  179.          
  180.       # Set the cache for static contents
  181.          location ~* \.(gif|jpg|png|svg|tiff|pdf|ico)$ {
  182.             expires    30d;
  183.          }
  184.  
  185. }
  186.  
  187. # SSL config
  188.  
  189. server {
  190.  
  191. #        listen 5.45.72.16:80;
  192. #        listen 5.45.72.16:443 ssl;
  193.  
  194.     listen 5.45.76.236:80;
  195.     listen 5.45.76.236:443 ssl;
  196.  
  197.     listen 5.45.72.45:80;
  198.  
  199.         server_name ya888ya.org ya888ya.win www.ya888ya.win ru.ya888ya.win;
  200.  
  201.         auth_basic "Access limited by ISPmanager";
  202.         auth_basic_user_file /var/www/ad7/data/etc/access.v7-2.orionlab.ru.1B2M2Y8A.passwd;
  203.  
  204.         charset UTF-8;
  205.         disable_symlinks if_not_owner from=$root_path;
  206.         index index.html index.php;
  207.         root $root_path;
  208.  
  209.         set $root_path /var/www/ya8/data/www/ya888ya.org;
  210.         ssi on;
  211.  
  212.         ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  213.     ssl_prefer_server_ciphers on;
  214.  
  215.     ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
  216.  
  217.     ssl_dhparam   /var/www/httpd-cert/dhgroup/dhparams_ya888ya.pem;
  218.  
  219.          # Принудительный https
  220.  
  221. #        if ( $scheme = "http" ) {
  222. #                rewrite ^/(.*)$   https://$host/$1 permanent;
  223. #        }
  224.  
  225.      if ($host = ya888ya.org) {
  226.               return 301 $scheme://ru.ya888ya.win;
  227.         }
  228.  
  229.         if ($host = ya888ya.win) {
  230.               return 302 $scheme://www.ya888ya.win;
  231.         }
  232.  
  233.         if ($host = www.ya888ya.win) {
  234.               return 302 $scheme://ru.ya888ya.win;
  235.         }
  236.  
  237.  
  238.         access_log /var/www/httpd-logs/ya888ya.org.access.log;
  239.         error_log /var/www/httpd-logs/ya888ya.org.error.log notice;
  240.  
  241.         #*** Lock request by user agent
  242. #        if ($http_user_agent = "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36" ) {
  243. #           return 403;
  244. #        }
  245.  
  246.  
  247.        location / {
  248.  
  249. #Блокировка город/страна - файл geomap.conf
  250.  
  251.         if ($allowed_country = no) {
  252.             return 403;
  253.         }
  254.  
  255.         if ($allowed_city = no) {
  256.             return 403;
  257.         }
  258.  
  259. #Открытие доступа игрокам из Крыма
  260.  
  261.         if ($crimea_city = yes) {
  262.           set $geoip2_data_country_code RU;
  263.         }
  264.  
  265.                 # First attempt to serve request as file, then
  266.                 # as directory, then fall back to index.html
  267.  
  268.                 #rewrite ^/(games/slots)$ / redirect;
  269.  
  270.                 #try_files $uri $uri/ /index.html;
  271.                 expires off;
  272.  
  273. #               try_files $uri $uri/ @kohana;
  274.                 try_files $uri /index.php?$query_string;
  275.  
  276.                 #504 error recovering
  277.                 proxy_read_timeout 300;
  278.  
  279.                 # Uncomment to enable naxsi on this location
  280.                # include /etc/nginx/naxsi.rules
  281.         }
  282.  
  283.       #подгрузка картинок из seo.orionlab.ru на проекты со скрытием домена
  284.  
  285.         location ^~ /uploads {
  286.                 try_files $uri $uri/ /seo_uploads$uri;
  287.         }
  288.  
  289.         location ^~ /seo_uploads {
  290.  
  291.                 proxy_pass http://seo.orionlab.ru/;
  292.                 proxy_redirect http://seo.orionlab.ru/ /;
  293.  
  294.         }
  295.  
  296.  
  297.         location /data.json {
  298.                 rewrite ^(.*)$ /media/lobby/data.json redirect;
  299.         }
  300.  
  301.         location /windows.swf {
  302.                 rewrite ^(.*)$ /media/lobby/windows.swf redirect;
  303.         }
  304.  
  305.         location /lobby.swf {
  306.                 rewrite ^(.*)$ /media/lobby/lobby.swf redirect;
  307.         }
  308.  
  309.         location /menu.swf {
  310.  
  311.                 rewrite ^(.*)$ /media/lobby/menu.swf redirect;
  312.  
  313.         }
  314.  
  315.         location /player/logout.json {
  316.                 rewrite ^(.*)$ /media/lobby/player/logout.json redirect;
  317.         }
  318.  
  319.    location @kohana {
  320.         rewrite ^/(.+)$ /index.php$request_uri last;
  321.     }
  322.  
  323.     # Don't log robots.txt or favicon.ico files
  324.     location = /favicon.ico { log_not_found off; access_log off; }
  325.  
  326.   location = /robots.txt  {
  327.  
  328. #       rewrite ^(.*)$ /index.php/$0 break;
  329.         access_log off;
  330.         log_not_found off;
  331.         try_files $uri @kohana;
  332.  
  333.    }
  334.  
  335.     # 404 errors handled by our application, for instance Laravel or CodeIgniter
  336.     error_page 404 /index.php;
  337.  
  338. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  339.     location ~ \.php$ {
  340.             try_files $uri $uri/ @kohana;
  341.             #fastcgi_pass unix:/var/run/php5-fpm.sock;
  342.             fastcgi_pass 127.0.0.1:9000;
  343.             #fastcgi_split_path_info ^(.+\.php)(/.+)$;
  344.             # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  345.             include fastcgi_params;
  346. # added for kohana
  347.             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  348.  
  349.             fastcgi_param  KOHANA_ENV production;
  350.  
  351. #Симуляция передачи заголовка Geoip от Cloudflare
  352.  
  353.             fastcgi_param HTTP_CF_IPCOUNTRY "$geoip2_data_country_code";
  354.  
  355.  
  356.             fastcgi_cache off;
  357. #504 error recovering
  358.             fastcgi_read_timeout 180;
  359.  
  360.             # With php5-cgi alone:
  361.             # fastcgi_pass 127.0.0.1:9000;
  362.             # With php5-fpm:
  363.             fastcgi_index index.php;
  364.     }
  365.  
  366.          # Deny access to files starting with dot (.htaccess, .svn, etc)
  367.          location  ~ /\. {
  368.              deny all;
  369.          }
  370.  
  371.       # Set the cache for static contents
  372.          location ~* \.(gif|jpg|png|svg|tiff|pdf|ico)$ {
  373.             expires    30d;
  374.          }
  375.  
  376.    ssl_certificate /var/www/httpd-cert/ya8/ya888ya.org_namecheap.crt;
  377.    ssl_certificate_key /var/www/httpd-cert/ya8/ya888ya.org_namecheap.key;
  378.  
  379. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement