Skip to content

Instantly share code, notes, and snippets.

@Knase
Created October 8, 2020 19:38
Show Gist options
  • Select an option

  • Save Knase/c1ab2ea309c52ca4b351be78d1e3eeba to your computer and use it in GitHub Desktop.

Select an option

Save Knase/c1ab2ea309c52ca4b351be78d1e3eeba to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name magento19.ll;
root /var/www/magento19;
index index.html index.php;
autoindex off;
location ~ (^/(app/\|includes/\|lib/\|/pkginfo/\|var/\|report/config.xml)\|/\.svn/\|/\.git/\|/.hta.+) {
deny all; #ensure sensitive files are not accessible
}
location / {
try_files $uri $uri/ /index.php?$args; # make index.php handle requests for /
access_log off; # do not log access to static files
# expires max; # cache static files aggressively
}
location ~* .(jpeg|jpg|gif|png|css|js|ico|swf)$ {
try_files $uri $uri/ @proxy; # look for static files in root directory and ask backend if not successful
# expires max;
access_log off;
}
location @proxy {
fastcgi_pass fastcgi_backend; # proxy everything from this location to backend
}
location ~.php$ {
try_files $uri =404; # if reference to php executable is invalid return 404
expires off; # no need to cache php executable files
fastcgi_read_timeout 36000;
fastcgi_pass fastcgi_backend; # proxy all requests for dynamic content to
# backend configured in upstream.conf
fastcgi_keep_conn on; # use persistent connects to backend
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root${fastcgi_script_name};
fastcgi_param MAGE_RUN_CODE default; # Store code is defined in
#administration > Configuration > Manage Stores
#fastcgi_param MAGE_RUN_TYPE store;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment