Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 444 ssl spdy; ## SPDY is On! SPDY could be activated only when SSL options is on either
- root /var/www/example.com/htdocs/; ## Don't forget to specify a correct path
- index index.html index.php;
- server_name example.com; ## Don't forget to specify a correct domain name
- ssl on; ## Turning SSL on. Certificate are mandatory. Use http://startssl.com to obtain free one.
- ssl_certificate /etc/apache2/ssl/example.com.crt;
- ssl_certificate_key /etc/apache2/ssl/example.comkey;
- proxy_send_timeout 600;
- proxy_read_timeout 600;
- error_log /var/www/example.com/logs/nginx-error.log;
- access_log /var/www/example.com/logs/nginx-access.log;
- location /us/ {
- set $mage_run_code 'store_usa'; ## Important! Here you MUST to set your webstore-specific store code! (System->Manage Stores in Magento)
- index index.html index.php; ## Allow a static html file to be shown first
- try_files $uri $uri/ @store_us; ## If missing pass the URI to Magento's front handler
- expires 30d; ## Assume all files are cacheable
- }
- location /ca/ {
- set $mage_run_code "store_ca"; ## Important! Here you MUST to set your webstore-specific store code! (System->Manage Stores in Magento)
- index index.html index.php; ## Allow a static html file to be shown first
- try_files $uri $uri/ @store_ca; ## If missing pass the URI to Magento's front handler
- expires 30d; ## Assume all files are cacheable
- }
- location / { ## This location block makes working your start page http://example.com/ (i. e. without /us or /ca)
- index index.html index.php; ## Allow a static html file to be shown first
- try_files $uri $uri/ @default; ## If missing pass the URI to Magento's front handler
- expires 30d; ## Assume all files are cacheable
- }
- ## These locations should be hidden
- location ^~ /app/ { deny all; }
- location ^~ /includes/ { deny all; }
- location ^~ /lib/ { deny all; }
- location ^~ /media/downloadable/ { deny all; }
- location ^~ /pkginfo/ { deny all; }
- location ^~ /report/config.xml { deny all; }
- location ^~ /var/ { deny all; }
- location /var/export/ { ## Allow admins only to view export folder
- auth_basic "Restricted"; ## Message shown in login window
- auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
- autoindex on;
- }
- location /. { ## Disable .htaccess and other hidden files
- return 404;
- }
- location @default { ## Handler for http://example.com/
- rewrite / /index.php;
- }
- location @store_us { ## Handler for http://example.com/us/
- rewrite / /us/index.php;
- }
- location @store_ca { ## Handler for http://example.com/ca/
- rewrite / /ca/index.php;
- }
- location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
- rewrite ^(.*.php)/ $1 last;
- }
- location ~ /us/index.php {
- if (!-e $request_filename) { rewrite / /us/index.php last; } ## Catch 404s that try_files miss
- expires off; ## Do not cache dynamic content
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_param HTTPS $fastcgi_https;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param MAGE_RUN_CODE $mage_run_code;
- fastcgi_param MAGE_RUN_TYPE website;
- include fastcgi_params; ## See /etc/nginx/fastcgi_params
- }
- location ~ /ca/index.php {
- if (!-e $request_filename) { rewrite / /ca/index.php last; } ## Catch 404s that try_files miss
- expires off; ## Do not cache dynamic content
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_param HTTPS $fastcgi_https;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param MAGE_RUN_CODE $mage_run_code;
- fastcgi_param MAGE_RUN_TYPE website;
- include fastcgi_params; ## See /etc/nginx/fastcgi_params
- }
- location ~ .php$ { ## Execute PHP scripts
- if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss
- expires off; ## Do not cache dynamic content
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_param HTTPS $fastcgi_https;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params; ## See /etc/nginx/fastcgi_params
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement