Advertisement
Guest User

Untitled

a guest
Aug 6th, 2015
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.08 KB | None | 0 0
  1. server {
  2.    
  3.     server_name stony.local br.stony.local;
  4.    
  5.     root /Users/marcus/Htdocs/stony;
  6.     index index.php index.html index.htm;
  7.  
  8.     if ($host ~* ^www\.(.*)){
  9.         set $host_without_www $1;
  10.         rewrite ^/(.*)$ $scheme://$host_without_www/$1 permanent;
  11.     }
  12.    
  13.     if ($host ~* (.*)\.stony\.local) {
  14.         set $sub_domain $1;
  15.         rewrite ^(.*)$ /$1?lang=$sub_domain last;
  16.     }
  17.    
  18.     if ($request_uri ~* ^(/principal(/index)?|/index(.php)?)/?$) {
  19.         rewrite ^(.*)$ / permanent;
  20.     }
  21.  
  22.     if ($request_uri ~* index/?$) {
  23.         rewrite ^/(.*)/index/?$ /$1 permanent;
  24.     }
  25.  
  26.     if (!-d $request_filename) {
  27.         rewrite ^/(.+)/$ /$1 permanent;
  28.     }
  29.  
  30.    
  31.     if ($request_uri ~* ^/system) {
  32.         rewrite ^/(.*)$ /index.php?/$1 last;
  33.         break;
  34.     }
  35.  
  36.     if (!-e $request_filename) {
  37.         rewrite ^/(.*)$ /index.php?/$1 last;
  38.         break;
  39.     }
  40.  
  41.     error_page 404 /index.php;
  42.        
  43.     location ~ \.php$ {
  44.         fastcgi_pass 127.0.0.1:9000;
  45.         fastcgi_index index.php;
  46.         fastcgi_param SCRIPT_FILENAME /Users/marcus/Htdocs/stony$fastcgi_script_name;
  47.         include fastcgi_params;
  48.     }
  49.  
  50.     location ~ /\.ht {
  51.         deny all;
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement