Skip to content

Instantly share code, notes, and snippets.

@mindo
Created May 22, 2012 11:48
Show Gist options
  • Save mindo/2768564 to your computer and use it in GitHub Desktop.
Save mindo/2768564 to your computer and use it in GitHub Desktop.
nginx config for vhost staging.domain.com
server {
listen 80;
listen 443 default_server ssl;
server_name staging.domain.com *.staging.domain.com ;
ssl_certificate /etc/pki/tls/certs/domain.com.crt;
ssl_certificate_key /etc/pki/tls/private/domain.com.key;
root /var/www/html/staging/web;
location ~* ^/callback/ {
try_files $uri $uri/ /index.php$uri?$args;
}
location / {
if ($server_port != 443) { rewrite ^ https://$host$request_uri? permanent; }
index index.php;
try_files $uri $uri/ /index.php$uri?$args;
}
location ~ "^(.+\.php)($|/)" {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param HTTPS on;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment