@@ -0,0 +1,113 @@
+server {
+ include /etc/nginx/port.conf;
+ server_name example.com;
+ return 301 $scheme://www.example.com$request_uri;
+}
+
+server {
+ include /etc/nginx/port.conf;
+ #listen 443 ssl;
+ server_name www.example.com; ## Domain is here
+ root /var/www/html;
+ access_log /var/log/nginx/access_www.example.com.log main;
+
+ if ($http_user_agent = "") { return 444;}
+
+ ####################################################################################
+ ## SSL CONFIGURATION
+
+ #ssl_certificate /etc/ssl/certs/www_server_com.chained.crt;
+ #ssl_certificate_key /etc/ssl/certs/server.key;
+
+ ####################################################################################
+ ## Server maintenance block. insert dev ip 1.2.3.4 static address www.whatismyip.com
+
+ #if ($remote_addr !~ "^(1.2.3.4|1.2.3.4)$") {
+ #return 503;
+ #}
+
+ #error_page 503 @maintenance;
+ #location @maintenance {
+ #rewrite ^(.*)$ /error_page/503.html break;
+ #internal;
+ #access_log off;
+ #log_not_found off;
+ #}
+
+ ####################################################################################
+ ## 403 error log/page
+
+ #error_page 403 /403.html;
+ #location = /403.html {
+ #root /var/www/html/error_page;
+ #internal;
+ #access_log /var/log/nginx/403.log error403;
+ #}
+
+ ####################################################################################
+ ## Main Magento location
+
+ location / {
+ try_files $uri $uri/ @handler;
+ }
+
+ ####################################################################################
+ ## These locations would be hidden by .htaccess normally, protected
+
+ location ~ (/(app/|includes/|pkginfo/|var/|errors/local.xml)|/\.) {
+ deny all;
+ }
+
+ ####################################################################################
+ ## Protecting /admin/ and /downloader/ 1.2.3.4 = static ip (www.whatismyip.com)
+
+ #location /downloader/ {
+ #allow 1.2.3.4; allow 1.2.3.4; deny all;
+ #rewrite ^/downloader/(.*)$ /downloader/index.php$1;
+ #}
+ #location /admin {
+ #allow 1.2.3.4; allow 1.2.3.4; deny all;
+ #rewrite / /@handler;
+ #}
+
+ ####################################################################################
+ ## Images, scripts and styles set far future Expires header
+
+ location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
+ open_file_cache max=10000 inactive=8h;
+ open_file_cache_valid 1h;
+ open_file_cache_min_uses 2;
+ open_file_cache_errors off;
+ expires max;
+ log_not_found off;
+ access_log off;
+ }
+
+ ####################################################################################
+ ## Main Magento location
+
+ location @handler {
+ rewrite / /index.php?$args;
+ }
+
+ location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
+ rewrite ^(.*.php)/ $1 last;
+ }
+
+ ####################################################################################
+ ## Execute PHP scripts
+
+ location ~ .php$ {
+ add_header X-UA-Compatible 'IE=Edge,chrome=1';
+ add_header X-Time-Spent $request_time;
+ try_files $uri $uri/ =404;
+ fastcgi_pass 127.0.0.1:9000;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ ## Store code with multi domain
+ #fastcgi_param MAGE_RUN_CODE $storecode;
+ ## Default Store code
+ fastcgi_param MAGE_RUN_CODE default;
+ fastcgi_param MAGE_RUN_TYPE store; ## or website;
+ include fastcgi_params; ## See /etc/nginx/fastcgi_params
+ }
+ }
|