Last active
August 29, 2015 14:09
-
-
Save michaelhoang/cd6e3ca5eded981c6c55 to your computer and use it in GitHub Desktop.
Vhost in Nginx
This file contains 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
#Add new vhost in Nginx | |
server { | |
listen *:80; | |
server_name example.local www.example.local; | |
index index.html index.htm index.php; | |
access_log /var/log/nginx/example.local.access.log; | |
error_log /var/log/nginx/example.local.error.log; | |
location / { | |
root /var/www/example; | |
try_files $uri $uri/ index.php /index.php$is_args$args; | |
} | |
location ~ \.php$ { | |
root /var/www/example; | |
index index.html index.htm index.php; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $request_filename; | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_split_path_info ^(.+\.php)(/.*)$; | |
include fastcgi_params; | |
} | |
sendfile off; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment