<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://techwiki.co.uk/index.php?action=history&amp;feed=atom&amp;title=Magento_2_Nginx_Config</id>
	<title>Magento 2 Nginx Config - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://techwiki.co.uk/index.php?action=history&amp;feed=atom&amp;title=Magento_2_Nginx_Config"/>
	<link rel="alternate" type="text/html" href="http://techwiki.co.uk/index.php?title=Magento_2_Nginx_Config&amp;action=history"/>
	<updated>2026-05-27T01:39:44Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>http://techwiki.co.uk/index.php?title=Magento_2_Nginx_Config&amp;diff=94&amp;oldid=prev</id>
		<title>Adam.birds: Created page with &quot;    upstream fastcgi_backend {         server   unix:/var/run/php5-fpm.sock;     }     server {         listen 80;         server_name mage.dev;         set $MAGE_ROOT /var/ww...&quot;</title>
		<link rel="alternate" type="text/html" href="http://techwiki.co.uk/index.php?title=Magento_2_Nginx_Config&amp;diff=94&amp;oldid=prev"/>
		<updated>2016-04-28T10:45:54Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;    upstream fastcgi_backend {         server   unix:/var/run/php5-fpm.sock;     }     server {         listen 80;         server_name mage.dev;         set $MAGE_ROOT /var/ww...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;    upstream fastcgi_backend {&lt;br /&gt;
        server   unix:/var/run/php5-fpm.sock;&lt;br /&gt;
    }&lt;br /&gt;
    server {&lt;br /&gt;
        listen 80;&lt;br /&gt;
        server_name mage.dev;&lt;br /&gt;
        set $MAGE_ROOT /var/www/magento2;&lt;br /&gt;
        set $MAGE_MODE developer;&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    root $MAGE_ROOT/pub;&lt;br /&gt;
    &lt;br /&gt;
    index index.php;&lt;br /&gt;
    autoindex off;&lt;br /&gt;
    charset off;&lt;br /&gt;
    &lt;br /&gt;
    location /setup {&lt;br /&gt;
        root $MAGE_ROOT;&lt;br /&gt;
        location ~ ^/setup/index.php {&lt;br /&gt;
            fastcgi_pass   fastcgi_backend;&lt;br /&gt;
            fastcgi_index  index.php;&lt;br /&gt;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;&lt;br /&gt;
            include        fastcgi_params;&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        location ~ ^/setup/(?!pub/). {&lt;br /&gt;
            deny all;&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        location ~ ^/setup/pub/ {&lt;br /&gt;
            add_header X-Frame-Options &amp;quot;SAMEORIGIN&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    location /update {&lt;br /&gt;
        root $MAGE_ROOT;&lt;br /&gt;
    &lt;br /&gt;
        location ~ ^/update/index.php {&lt;br /&gt;
            fastcgi_split_path_info ^(/update/index.php)(/.+)$;&lt;br /&gt;
            fastcgi_pass   fastcgi_backend;&lt;br /&gt;
            fastcgi_index  index.php;&lt;br /&gt;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;&lt;br /&gt;
            fastcgi_param  PATH_INFO        $fastcgi_path_info;&lt;br /&gt;
            include        fastcgi_params;&lt;br /&gt;
        }&lt;br /&gt;
     &lt;br /&gt;
        # deny everything but index.php&lt;br /&gt;
        location ~ ^/update/(?!pub/). {&lt;br /&gt;
            deny all;&lt;br /&gt;
        }&lt;br /&gt;
     &lt;br /&gt;
        location ~ ^/update/pub/ {&lt;br /&gt;
            add_header X-Frame-Options &amp;quot;SAMEORIGIN&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    location / {&lt;br /&gt;
        try_files $uri $uri/ /index.php?$args;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    location /pub {&lt;br /&gt;
        location ~ ^/pub/media/(downloadable|customer|import|theme_customization/.*\.xml) {&lt;br /&gt;
            deny all;&lt;br /&gt;
        }&lt;br /&gt;
        alias $MAGE_ROOT/pub;&lt;br /&gt;
        add_header X-Frame-Options &amp;quot;SAMEORIGIN&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    location /static/ {&lt;br /&gt;
        if ($MAGE_MODE = &amp;quot;production&amp;quot;) {&lt;br /&gt;
            expires max;&lt;br /&gt;
        }&lt;br /&gt;
        location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {&lt;br /&gt;
            add_header Cache-Control &amp;quot;public&amp;quot;;&lt;br /&gt;
            add_header X-Frame-Options &amp;quot;SAMEORIGIN&amp;quot;;&lt;br /&gt;
            expires +1y;&lt;br /&gt;
    &lt;br /&gt;
            if (!-f $request_filename) {&lt;br /&gt;
                rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {&lt;br /&gt;
            add_header Cache-Control &amp;quot;no-store&amp;quot;;&lt;br /&gt;
            add_header X-Frame-Options &amp;quot;SAMEORIGIN&amp;quot;;&lt;br /&gt;
            expires    off;&lt;br /&gt;
    &lt;br /&gt;
            if (!-f $request_filename) {&lt;br /&gt;
               rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        if (!-f $request_filename) {&lt;br /&gt;
            rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;&lt;br /&gt;
        }&lt;br /&gt;
        add_header X-Frame-Options &amp;quot;SAMEORIGIN&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    location /media/ {&lt;br /&gt;
        try_files $uri $uri/ /get.php?$args;&lt;br /&gt;
    &lt;br /&gt;
        location ~ ^/media/theme_customization/.*\.xml {&lt;br /&gt;
            deny all;&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {&lt;br /&gt;
            add_header Cache-Control &amp;quot;public&amp;quot;;&lt;br /&gt;
            add_header X-Frame-Options &amp;quot;SAMEORIGIN&amp;quot;;&lt;br /&gt;
            expires +1y;&lt;br /&gt;
            try_files $uri $uri/ /get.php?$args;&lt;br /&gt;
        }&lt;br /&gt;
        location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {&lt;br /&gt;
            add_header Cache-Control &amp;quot;no-store&amp;quot;;&lt;br /&gt;
            add_header X-Frame-Options &amp;quot;SAMEORIGIN&amp;quot;;&lt;br /&gt;
            expires    off;&lt;br /&gt;
            try_files $uri $uri/ /get.php?$args;&lt;br /&gt;
        }&lt;br /&gt;
        add_header X-Frame-Options &amp;quot;SAMEORIGIN&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    location /media/customer/ {&lt;br /&gt;
        deny all;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    location /media/downloadable/ {&lt;br /&gt;
        deny all;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    location /media/import/ {&lt;br /&gt;
        deny all;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    location ~ cron\.php {&lt;br /&gt;
        deny all;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    location ~ (index|get|static|report|404|503)\.php$ {&lt;br /&gt;
        try_files $uri =404;&lt;br /&gt;
        fastcgi_pass   fastcgi_backend;&lt;br /&gt;
    &lt;br /&gt;
        fastcgi_param  PHP_FLAG  &amp;quot;session.auto_start=off \n suhosin.session.cryptua=off&amp;quot;;&lt;br /&gt;
        fastcgi_param  PHP_VALUE &amp;quot;memory_limit=256M \n max_execution_time=600&amp;quot;;&lt;br /&gt;
        fastcgi_read_timeout 600s;&lt;br /&gt;
        fastcgi_connect_timeout 600s;&lt;br /&gt;
        fastcgi_param  MAGE_MODE $MAGE_MODE;&lt;br /&gt;
    &lt;br /&gt;
        fastcgi_index  index.php;&lt;br /&gt;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;&lt;br /&gt;
        include        fastcgi_params;&lt;br /&gt;
    }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
[[Category:Nginx]]&lt;br /&gt;
[[Category:Magento]]&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
[[Category:Contents]]&lt;/div&gt;</summary>
		<author><name>Adam.birds</name></author>
		
	</entry>
</feed>