Skip to content

Instantly share code, notes, and snippets.

@temuri416
Created March 19, 2014 00:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save temuri416/9633097 to your computer and use it in GitHub Desktop.
Save temuri416/9633097 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name fls.myhost.mobi;
return 301 https://fls.myhost.mobi;
}
server {
server_name fls.myhost.mobi;
listen 443;
ssl on;
ssl_certificate /etc/ssl/myhost-mobi-ssl.crt;
ssl_certificate_key /etc/ssl/myhost-mobi.key;
access_log /var/log/fls.myhost-access-ssl.log;
error_log /var/log/fls.myhost-error-ssl.log;
set $root_path '/var/web/nginx/html/fls.myhost.mobi/public';
set $baseURI '/';
root $root_path;
index index.php;
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect off;
try_files $uri $uri/ @php_mvc;
}
location @php_mvc {
rewrite ^(.+)$ /index.php?_url=$1 last;
}
location ~ ^(.+\.php)(/.*)?$ {
fastcgi_split_path_info ^(.+\.php)(/.*)?$;
set $script_filename $document_root$fastcgi_script_name;
if (!-e $script_filename) {
return 404;
}
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param APPLICATION_ENV production;
fastcgi_param SCRIPT_FILENAME $script_filename;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param BASEURI $baseURI;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment