RedFoxy

softairmania.it.conf

Mar 24th, 2017
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 7.17 KB | None | 0 0
  1. server
  2. {
  3.   listen      *:80;
  4.   listen      *:443;
  5.   server_name softairmania.it ww.softairmania.it w.softairmania.it wwww.softairmania.it samweb1.softairmania.it samweb2.softairmania.it;
  6.   return 301  $scheme://www.softairmania.it$request_uri;
  7. }
  8.  
  9. server
  10. {
  11.   set $root_sito /home/web/htdocs/softairmania.it/public_html;
  12.   root  $root_sito;
  13.  
  14.   listen      *:80;
  15.   listen      *:443;
  16.   server_name www.softairmania.it;
  17.  
  18.   ssl_certificate     /usr/local/etc/letsencrypt/live/softairmania.it/fullchain.pem;
  19.   ssl_certificate_key /usr/local/etc/letsencrypt/live/softairmania.it/privkey.pem;
  20.  
  21.  
  22.   access_log /home/serverweb/log/nginx/softairmania.it/www-access.log rt_cache;
  23.   error_log  /home/serverweb/log/nginx/softairmania.it/www-error.log notice;
  24.  
  25. #  set $skip_cache 0;
  26.  
  27.   # POST requests and urls with a query string should always go to PHP
  28. #  if ($request_method = POST) {
  29. #    set $skip_cache 1;
  30. #  }  
  31. #  if ($query_string != "") {
  32. #    set $skip_cache 1;
  33. #  }  
  34.  
  35.   # Don't cache uris containing the following segments
  36. #  if ($request_uri ~* "/wp-admin/|/xmlrpc.php|wp-.*.php|/feed/|index.php|sitemap(_index)?.xml") {
  37. #    set $skip_cache 1;
  38. #  }  
  39.  
  40.   # Don't use the cache for logged in users or recent commenters
  41. #  if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
  42. #    set $skip_cache 1;
  43. #  }
  44.  
  45.   # Don't cache shopping basket, checkout or account pages
  46. #  if ($request_uri ~* "/cart/*$|/checkout/*$|/my-account/*$") {
  47. #    set $skip_cache 1;
  48. #  }
  49.  
  50.   # Don't cache shopping basket, checkout or account pages
  51. #  if ($request_uri ~* "/admin-cp/*|/mod-cp/*|") {
  52. #    set $skip_cache 1;
  53. #  }
  54.  
  55.   location ~ /.well-known {
  56.     allow all;
  57.   }
  58.  
  59.   location ~ /\. { deny  all; }
  60.  
  61.   index index.php index.html index.htm;
  62.  
  63. #    include /home/serverweb/etc/nginx/_conf/awstats.conf;
  64.   include /home/serverweb/etc/nginx/_conf/php.conf;
  65.   set $wp_subdir "/portale";
  66.  
  67.   rewrite /wp-admin$ $scheme://$host$uri/ permanent;
  68.  
  69.   rewrite ^/(sitemap|portale/sitemap)(-+([a-zA-Z0-9_-]+))?\.xml$     "/portale/index.php?xml_sitemap=params=$3"                    last;
  70.   rewrite ^/(sitemap|portale/sitemap)(-+([a-zA-Z0-9_-]+))?\.xml\.gz$ "/portale/index.php?xml_sitemap=params=$3;zip=true"           last;
  71.   rewrite ^/(sitemap|portale/sitemap)(-+([a-zA-Z0-9_-]+))?\.html$    "/portale/index.php?xml_sitemap=params=$3;html=true"          last;
  72.   rewrite ^/(sitemap|portale/sitemap)(-+([a-zA-Z0-9_-]+))?\.html.gz$ "/portale/index.php?xml_sitemap=params=$3;html=true;zip=true" last;
  73.  
  74.   rewrite ^/(portale/useronline|content|content/)$                   "/portale/"                                                   redirect;
  75.  
  76.   rewrite ^/shop/(.*)   "/portale/negozio/" redirect;
  77.  
  78.   location ~* \.(bmp|bz2|css|doc|exe|gz|htm|html|htmls|js|mid|midi|pdf|ppt|rar|rtf|tar|tgz|txt|wav|xls|xml|zip)$
  79.   {
  80.     rewrite ^/archive/index.php/t-([0-9]+)\.html /archive/index.php?t-$1.html last;
  81.     rewrite ^/archive/index.php/f-([0-9]+)\.html /archive/index.php?f-$1.html last;
  82.  
  83.     rewrite ^/(forums|entries|threads|members|forums|blogs|list|content|widget)/clientscript/(.*)  /clientscript/$2 last;
  84.     expires  3m;
  85.   }
  86.  
  87.   location ~* \.(jpg|jpeg|gif|png|ico)$
  88.   {
  89.     rewrite_log off;
  90.     error_log  /home/serverweb/log/nginx/softairmania.it/image-error.log error;
  91.  
  92.     rewrite ^/(forums|entries|threads|members|forums|blogs|list|content|widget)(.*)/images/(.*)        /images/$3        last;
  93.     rewrite ^/(forums|entries|threads|members|forums|blogs|list|content|widget)(.*)/customavatars/(.*) /customavatars/$2 last;
  94.     rewrite ^/(forums|entries|threads|members|forums|blogs|list|content|widget)(.*)/signaturepics/(.*) /signaturepics/$2 last;
  95.  
  96. #        rewrite ^/(forums|entries|threads|members|forums|blogs|list|content|widget)/images/(.*)            /images/$2        last;
  97. #        rewrite ^/(forums|entries|threads|members|forums|blogs|list|content|widget)/customavatars/(.*)     /customavatars/$2 last;
  98. #        rewrite ^/(forums|entries|threads|members|forums|blogs|list|content|widget)/signaturepics/(.*)     /signaturepics/$2 last;
  99.  
  100.     expires    3m;
  101.     error_page  404  /not-found.png;
  102.   }
  103.  
  104.   location ~* /portale
  105.   {
  106.     access_log /home/serverweb/log/nginx/softairmania.it/portale-access.log;
  107.     error_log  /home/serverweb/log/nginx/softairmania.it/portale-error.log error;
  108.  
  109.     try_files $uri $uri/ /portale/index.php?q=$uri&$args;
  110.   }
  111.  
  112.   location /
  113.   {
  114. #        access_log /home/serverweb/log/nginx/softairmania.it/www-access.log;
  115. #        error_log  /home/serverweb/log/nginx/softairmania.it/www-error.log error;
  116.  
  117.     rewrite ^/forum/threads/.*              /showthread.php?t=$1&p=$2&$query_string last;
  118.  
  119.     rewrite ^/threads/.*                    /showthread.php?t=$1&p=$2&$query_string last;
  120.     rewrite ^/forums/.*                     /forumdisplay.php?$query_string         last;
  121.     rewrite ^/members/.*                    /member.php?u=$1&$query_string          last;
  122.     rewrite ^/blogs/.*                      /blog.php?u=$1&p=$2&$query_string       last;
  123.     rewrite ^/entries/.*                    /entry.php?b=$1&p=$2&$query_string      last;
  124.  
  125. #     CMS vb disabilitato
  126. #        rewrite ^/list/.*                       /list.php?r=$1$2&$query_string          last;
  127. #        rewrite ^/content/.*                    /content.php?r=$1&$query_string         last;
  128. #        rewrite ^/widget/.*                     /widget.php?r=config/$1&$query_string   last;
  129.  
  130.     rewrite  ^/regolamenti                  /misc.php?do=vsarules                   last;
  131.     rewrite  ^/regolamento_generale         /misc.php?do=vsarules&cfrset=1          last;
  132.     rewrite  ^/netiquette                   /misc.php?do=vsarules&cfrset=2          last;
  133.     rewrite  ^/regolamento_del_mercatino    /misc.php?do=vsarules&cfrset=3          last;
  134.     rewrite  ^/regolamento_tornei_ed_eventi /misc.php?do=vsarules&cfrset=5          last;
  135.     rewrite  ^/faq_del_mercatino            /misc.php?do=vsarules&cfrset=6          last;
  136.     rewrite  ^/staff                        /showgroups.php                         last;
  137.  
  138.     rewrite  ^/viewtopic.php(.*)            /showthread.php?$query_string           last;
  139.  
  140.     rewrite ^/forum/forumdisplay.php(.*)    /forumdisplay.php?$query_string         last;
  141.     rewrite ^/forum/showthread.php(.*)      /showthread.php?$query_string           last;
  142.     rewrite  ^/showthreadthread.php(.*)     /showthread.php?$query_string           last;
  143.  
  144.   #viewtopic.php    http://www.softairmania.it/viewtopic.php?t=40029&sid=f5444dee70c745faa95d18bf5ec78ca7
  145.   #forumdisplay.php  http://www.softairmania.it/forum/forumdisplay.php?f=166
  146.  
  147.     rewrite ^/(forums|forum|forum/)$        /forum.php                              last;
  148.   #   rewrite ^/sitemap\.(.*)                 /xmlsitemap.php?$query_string           last;
  149.  
  150.     rewrite ^/SAM-Wiki/([^?]*)(?:\?(.*))?   /samwiki/index.php?title=$1&$args       last;
  151.  
  152.     try_files $uri $uri/portale /portale/index.php?q=$request_uri;
  153.   }
  154.  
  155. #    error_page  500 502 503 504 /50x.html;
  156. #    location  = /50x.html
  157. #    {
  158. #       root  /home/serverweb/etc/nginx/_conf/error-page/;
  159. #    }
  160.  
  161.   location = /not-found.png
  162.   {
  163.     root  /home/serverweb/etc/nginx/_conf/error-page/;
  164.   }
  165. }
Advertisement
Add Comment
Please, Sign In to add comment