Skip to content

Instantly share code, notes, and snippets.

@clojens
Last active August 29, 2015 14:10
Show Gist options
  • Save clojens/1e6f28c3541e6707b06a to your computer and use it in GitHub Desktop.
Save clojens/1e6f28c3541e6707b06a to your computer and use it in GitHub Desktop.
Magento nginx
user http http;
worker_processes auto;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log logs/access.log main;
error_log logs/error.log warn;
sendfile on;
keepalive_timeout 120;
server {
listen 80;
server_name www.wb.tld;
root /srv/http/current/htdocs;
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; }
include php.conf;
}
server {
listen 80;
server_name www.sauna.gift;
root /srv/http/sauna.gift/shop/htdocs;
include php.conf;
}
server {
listen 80;
server_name www.ethr.tld;
root /srv/http/current/htdocs;
include php.conf;
}
server {
listen 80;
server_name www.adminer.tld;
root /srv/http/adminer;
include php.conf;
}
server {
listen 80;
server_name www.mage2.tld;
root /srv/http/mage2/shop/htdocs;
include php.conf;
}
}
location / {
index index.html index.php; ## Allow a static html file to be shown first
try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
expires 30d; ## Assume all files are cachable
}
location @handler {
rewrite / /index.php;
}
location ~ \.php/ {
rewrite ^(.*\.php)/ $1 last;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_intercept_errors on;
#include fastcgi_params;
#fastcgi_pass backend-php;
#fastcgi_split_path_info ^(.+\.php)(/.*)$;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_param QUERY_STRING $query_string;
#fastcgi_param PATH_INFO $fastcgi_script_name;
#fastcgi_param HTTPS off;
}
@clojens
Copy link
Author

clojens commented Nov 27, 2014

These are correct settings that prevent malfunctioning catalog catagory reload frenzy (reload in reload in reload of child of child you get the picture). Thing was the common front handler was missing in here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment