Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- server_name www.website.com;
- return 301 $scheme://website.com$request_uri;
- }
- server {
- listen 80;
- server_name website.com;
- rewrite_log on;
- index index.php index.html index.htm;
- location / {
- root /var/www/website.com/public;
- try_files $uri $uri/ @rewrites;
- }
- location /project1/ {
- root /var/www/website.com/project1/public;
- try_files $uri $uri/ @rewrites;
- }
- location /project2/ {
- root /var/www/website.com/project2/public;
- try_files $uri $uri/ @rewrites;
- }
- location @rewrites {
- rewrite ^(.*) /index.php?p=$1 last;
- }
- location ~ .php$ {
- try_files $uri =404;
- fastcgi_split_path_info ^(.+.php)(/.+)$;
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_index index.php;
- include fastcgi_params;
- }
- location ~* .(?:ico|css|js|gif|jpe?g|png|woff|woff2|ttf|otf|svg)$ {
- try_files $uri /index.php?$query_string;
- expires 14d;
- }
- error_page 404 /index.php;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement