Skip to content

Instantly share code, notes, and snippets.

@chrismeller
Created February 8, 2013 22:33
Show Gist options
  • Select an option

  • Save chrismeller/4742494 to your computer and use it in GitHub Desktop.

Select an option

Save chrismeller/4742494 to your computer and use it in GitHub Desktop.
Habari Nginx vhost example
server {
listen [::]:80;
server_name blog.chrismeller.com;
root /media/www/public_html/blog.chrismeller.com/public;
access_log /media/www/public_html/blog.chrismeller.com/logs/access.log;
error_log /media/www/public_html/blog.chrismeller.com/logs/error.log;
include fastcgi_params;
location / {
# force ssl for login and admin pages
rewrite ^/(admin|auth)(.*) https://$host$request_uri?;
try_files $uri $uri/ /index.php$is_args$args;
}
location /status {
fastcgi_pass php;
}
location /ping {
fastcgi_pass php;
}
location ~ \.php$ {
fastcgi_pass php;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment