Created
January 10, 2012 20:52
-
-
Save chrismeller/1591116 to your computer and use it in GitHub Desktop.
Standard Nginx Vhost
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
server { | |
include listen_80; | |
server_name vhost.com; | |
include /etc/nginx/fastcgi_params; | |
access_log /home/chris/public_html/vhost.com/logs/access.log; | |
error_log /home/chris/public_html/vhost.com/logs/error.log; | |
root /home/chris/public_html/vhost.com/public; | |
location / { | |
try_files $uri $uri/ /index.php; | |
} | |
location ~ \.php$ { | |
fastcgi_pass php; | |
} | |
location /status { | |
fastcgi_pass php; | |
} | |
location /ping { | |
fastcgi_pass php; | |
} | |
} |
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
server { | |
include listen_443; | |
server_name vhost.com; | |
ssl on; | |
ssl_certificate /etc/nginx/ssl/vhost.com.pem; | |
ssl_certificate_key /etc/nginx/ssl/vhost.com.key; | |
include /etc/nginx/fastcgi_params; | |
access_log /home/chris/public_html/vhost.com/logs/ssl.access.log; | |
error_log /home/chris/public_html/vhost.com/logs/ssl.error.log; | |
root /home/chris/public_html/vhost.com/ssl; | |
location / { | |
try_files $uri $uri/ /index.php; | |
} | |
location ~ \.php$ { | |
fastcgi_pass php; | |
} | |
location /status { | |
fastcgi_pass php; | |
} | |
location /ping { | |
fastcgi_pass php; | |
} | |
} |
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
server { | |
include listen_80; | |
server_name www.vhost.com; | |
rewrite ^ http://vhost.com$request_uri?; | |
} |
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
server { | |
include listen_443; | |
server_name www.vhost.com; | |
ssl on; | |
ssl_certificate /etc/nginx/ssl/vhost.com.pem; | |
ssl_certificate_key /etc/nginx/ssl/vhost.com.key; | |
rewrite ^ https://vhost.com$request_uri?; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment