Created
October 4, 2016 17:53
-
-
Save endrureza/dd206e48112daa0befa8667188981d0f to your computer and use it in GitHub Desktop.
Not Working VH Nginx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name scheduling.dev; | |
root /var/www/html/scheduling/public; | |
index index.php index.html index.htm; | |
# serve static files directly | |
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ { | |
access_log off; | |
expires max; | |
} | |
# removes trailing slashes (prevents SEO duplicate content issues) | |
if (!-d $request_filename) { | |
rewrite ^/(.+)/$ /$1 permanent; | |
} | |
# unless the request is for a valid file (image, js, css, etc.), send to bootstrap | |
if (!-e $request_filename) { | |
rewrite ^/(.*)$ /index.php?/$1 last; | |
break; | |
} | |
# removes trailing 'index' from all controllers | |
if ($request_uri ~* index/?$) { | |
rewrite ^/(.*)/index/?$ /$1 permanent; | |
} | |
# catch all | |
error_page 404 /index.php; | |
location ~ \.php$ { | |
include snippets/fastcgi-php.conf; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment