Advertisement
Guest User

NGINX configuration for October CMS

a guest
Apr 3rd, 2015
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 0.83 KB | None | 0 0
  1. server {
  2.  
  3.     listen 80;
  4.     server_name www.mywebsite.com;
  5.     rewrite ^/(.*) http://mywebsite.com/$1 permanent;
  6.  
  7. }
  8.  
  9. server {
  10.  
  11.     listen 80;
  12.     server_name mywebsite.com;
  13.  
  14.     if (!-e $request_filename)
  15.     {
  16.         rewrite ^/(.*)$ /index.php?/$1 break;
  17.         break;
  18.     }
  19.  
  20.     rewrite ^themes/.*/(layouts|pages|partials)/.*.htm /index.php break;
  21.     rewrite ^storage/app/uploads/protected/.* /index.php break;
  22.     rewrite ^app/.* /index.php break;
  23.  
  24.     location / {
  25.         try_files $uri $uri/ /index.php?$query_string;
  26.     }
  27.  
  28.     root /var/www/mywebsite;
  29.     index index.php index.html index.htm;
  30.  
  31.     location ~ \.php$ {
  32.         try_files $uri /index.php =404;
  33.         fastcgi_split_path_info ^(.+\.php)(/.+)$;
  34.         fastcgi_pass unix:/var/run/php5-fpm.sock;
  35.         fastcgi_index index.php;
  36.         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  37.         include fastcgi_params;
  38.     }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement