• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Magento 2 with only nginx rewrite rule

bulent

Regular Pleskian
Hi,
is someone knows working rewrite rules for Magento 2 using only nginx?

Thanks in advance
 
I can get M2 running using nginx only.. but still working on the install process
What is the problem with installation? Just use Apps magento 2 installer and install M2.1 and them upgade to M2.2.2 For me it works.
Which rewrite rules you are using?
 
Hi,
is someone knows working rewrite rules for Magento 2 using only nginx?

Thanks in advance

Hello @bulent , I will work on a tutorial about Magento 2.x installation/configuration/optimization with Plesk Onyx in the next few days, so I will try to see if I can configure Nginx properly or not. Currently the only Magento 2.2 instance running on my VPS use Nginx + Apache.
Otherwise, for bigger store, I do not use Plesk to run Magento at the moment due to the MariaDB compatiblity (10.2 for Magento, 10.1 for Plesk) and the fact I haven't found the time to work on a custom nginx vhost template for Magento.
 
It would be very interesting to know which settings in the directives you have, to get Magento 2.2 running as nxginx without proxy. Have tried different configurations. Unfortunately without success. It would be nice if someone would publish it. Thank you in advance.
 
What is the problem with installation? Just use Apps magento 2 installer and install M2.1 and them upgade to M2.2.2 For me it works.
Which rewrite rules you are using?
the problem is that the
magento 2.1.x and magento 2.2.2+ configurations different

It would be very interesting to know which settings in the directives you have, to get Magento 2.2 running as nxginx without proxy. Have tried different configurations. Unfortunately without success. It would be nice if someone would publish it. Thank you in advance.

if you wish to have own VirtualHost configuration and replace default plesk settings after magento 2 source script uploaded to web root directory by simple clicking " APPLY" or "OK" button in DOMAIN -> Apache & nginx Settings for domain


to create your own configuration template you can use this guide
Changing Virtual Hosts Settings Using Configuration Templates
with this condition
Code:
<?php if (is_file($OPT['ssl'] ? $VAR->domain->physicalHosting->httpsDir .'/bin/magento': $VAR->domain->physicalHosting->httpDir .'/bin/magento')):?>
template looks and defines magento-cli file in bin directory and recompiles to your own configuration


for examle if i wish to change only root directories rule
Code:
<?php if (is_file($OPT['ssl'] ? $VAR->domain->physicalHosting->httpsDir .'/bin/magento': $VAR->domain->physicalHosting->httpDir .'/bin/magento')):?>

### MAGENTO ROOT DIRECTORY RULE

    set $MAGE_ROOT "<?php echo $OPT['ssl'] ? $VAR->domain->physicalHosting->httpsDir : $VAR->domain->physicalHosting->httpDir ?>";
    root $MAGE_ROOT/pub;

<?php else: ?>

### PLESK ORIGINAL RULE
    root "<?php echo $OPT['ssl'] ? $VAR->domain->physicalHosting->httpsDir : $VAR->domain->physicalHosting->httpDir ?>";

<?php endif ?>


if you have enabled Plesk Mode Security DON'T use
Code:
 location ~ (index|get|static|report|404|503|health_check)\.php$ { }

you need use
Code:
 location ~ (index|get|static|report|404|503|health_check)\.php(/.*)?$ {  }

also
for location / { } or location ~ /$ { }
you need this rewrite rule
Code:
if (!-e $request_filename){ rewrite ^(/.*)([^/]+/)$ /index.php$is_args$args last; }

do not forget
magento 2.x requires
rule
Code:
index index.php;
autoindex off;
you can change indexer rule in backend in apache settings section
or directly in template

default plesk template
Code:
   <?php if ($VAR->domain->physicalHosting->directoryIndex): ?>
location ~ /$ {
    index <?=$VAR->quote($VAR->domain->physicalHosting->directoryIndex)?>;
}
plesk default settings template after compile returns
Code:
location ~ /$ {
   index "index.html" "index.cgi" "index.pl" "index.php" "index.xhtml" "index.htm" "index.shtml";
}

I'm working on more correct and precise template that to correctly use session paths for magento 2.x.x script
default magento nginx template in some case incorrect
so session save path incorrect , need to set ROOT path to WEBROOT dir and PUB must be rewrited
of course you can manually add path in PHP settings
Code:
session.save_path=/var/www/vhosts/YOUR_DOMAIN_TLD/httpdocs/var/session
in next few days
complete Step by Step guide and ready to use configuration template files will be posted in separate thread
me also working on complete script to configure server for Magento 2.x.x

you must take to consideration
that in NGINX only mode
WEB SETUP WIZARD option in Magento admin panel will be invisible

that to call WEB SETUP WIZARD you must to use url suffix /admin/backendapp/redirect/app/setup/
full url looks like
Code:
http://<shopurl>/<adminurl>/admin/backendapp/redirect/app/setup/
 
Last edited:
if you have enabled Plesk Mode Security DON'T use
Code:
 location ~ (index|get|static|report|404|503|health_check)\.php$ { }
all requests with \.php$ will be sent to apache
you need use
Code:
 location ~ (index|get|static|report|404|503|health_check)\.php(/.*)?$ {  }
[/QUOTE]

Many thanks Igo for replying.

The changes you posted I already made in /opt/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php to change root and works fine.

The problem is in PLESK ONYX under Additional nginx directives: please see attachmentAdditional_nginx_directives.png
There I set the following directives: please see attachment nginx.conf.pdf

My MAGENTO 2.2.2 projekt can be found under: Home page
Homepage is working. If I click any link I get an 404. Same if I try to call the adminpanel.

Would be nice to get a answer whats wrong. Thanks in advance.
Regardes
Christian
 

Attachments

  • Additional_nginx_directives.png
    Additional_nginx_directives.png
    68.3 KB · Views: 42
  • nginx.conf.pdf
    35.6 KB · Views: 50
if you have enabled Plesk Mode Security DON'T use

Many thanks Igo for replying.

The changes you posted I already made in /opt/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php to change root and works fine.

The problem is in PLESK ONYX under Additional nginx directives: please see attachmentAdditional_nginx_directives.png
There I set the following directives: please see attachment nginx.conf.pdf

My MAGENTO 2.2.2 projekt can be found under: Home page
Homepage is working. If I click any link I get an 404. Same if I try to call the adminpanel.

Would be nice to get a answer whats wrong. Thanks in advance.
Regardes
Christian

after compile working configuration

Code:
server {
    listen SERVER_IP:443 ssl http2;

    server_name DOMAIN_TLD;
    server_name www.DOMAIN_TLD;
    server_name ipv4.DOMAIN_TLD;

    ssl_certificate             /usr/local/psa/var/certificates/;
    ssl_certificate_key         /usr/local/psa/var/certificates/;
    ssl_client_certificate      /usr/local/psa/var/certificates/;

    set $MAGE_ROOT "/var/www/vhosts/DOMAIN_TLD/httpdocs";
    root $MAGE_ROOT/pub;
    index index.php;
    autoindex off;
    charset UTF-8;
    error_page 404 403 = /errors/404.php;

    access_log "/var/www/vhosts/system/DOMAIN_TLD/logs/proxy_access_ssl_log";
    error_log "/var/www/vhosts/system/DOMAIN_TLD/logs/proxy_error_log";

   location ~ ^/setup {
        root $MAGE_ROOT;
        location ~ ^/setup/index.php(/.*)?$ {
            fastcgi_pass "unix:///var/www/vhosts/system/DOMAIN_TLD/php-fpm.sock";
            fastcgi_split_path_info ^(/setup/index.php) (/.+)$;
            fastcgi_param  PHP_FLAG  "session.auto_start=off \n suhosin.session.cryptua=off";
            fastcgi_param  PHP_VALUE "memory_limit=756M \n max_execution_time=600";
            fastcgi_read_timeout 600s;
            fastcgi_connect_timeout 600s;

            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

        location ~ ^/setup/(?!pub/). {
            deny all;
        }

        location ~ ^/setup/pub/ {
            add_header X-Frame-Options "SAMEORIGIN";
        }
    }

    # PHP entry point for update application
    location ~ ^/update {
        root $MAGE_ROOT;
        location ~ ^/update/index.php(/.*)?$ {
            fastcgi_split_path_info ^(/update/index.php) (/.+)$;
            fastcgi_pass "unix:///var/www/vhosts/system/DOMAIN_TLD/php-fpm.sock";
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO        $fastcgi_path_info;
            include        fastcgi_params;
        }

        # Deny everything but index.php
        location ~ ^/update/(?!pub/). {
            deny all;
        }

        location ~ ^/update/pub/ {
            add_header X-Frame-Options "SAMEORIGIN";
        }
        if (!-e $request_filename){ rewrite ^(/.*)(/.+)$ /index.php$is_args$args last; }
    }
    location @fallback {
        return 404;
    }

    location / { try_files $uri $uri/ /index.php$is_args$args; }

    location /pub/ {
        location ~ ^/pub/media/(downloadable|customer|import|theme_customization/.*\.xml) { deny all; }
        alias $MAGE_ROOT/pub/;
        add_header X-Frame-Options "SAMEORIGIN";
    }

    location /static/ {
        # Uncomment the following line in production mode
        # expires max;

        # Remove signature of the static files that is used to overcome the browser cache
        location ~ ^/static/version { rewrite ^/static/(version[^/]+/)?(.*)$ /static/$2 last; }

        location ~ ^/(.*\.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2))$ {
            add_header Cache-Control "public";
            add_header X-Frame-Options "SAMEORIGIN";
            expires +1y;
            log_not_found off;
            access_log off;
            add_header ETag "";
            add_header Access-Control-Allow-Origin "www.DOMAIN_TLD, cdn.DOMAIN_TLD";

            if (!-f $request_filename) { rewrite ^/static/?(.*)$ /static.php?resource=$1 last; }
        }
        location ~ ^/(.*\.(zip|gz|gzip|bz2|csv|xml))$ {
            add_header Cache-Control "no-store";
            add_header X-Frame-Options "SAMEORIGIN";
            expires    off;
            log_not_found off;
            access_log off;
            add_header ETag "";
            add_header Access-Control-Allow-Origin "www.DOMAIN_TLD, cdn.DOMAIN_TLD";


            if (!-f $request_filename) { rewrite ^/static/?(.*)$ /static.php?resource=$1 last; }
        }

        if (!-f $request_filename) { rewrite ^/static/?(.*)$ /static.php?resource=$1 last; }
        add_header X-Frame-Options "SAMEORIGIN";
    }

    location /media/ {
        try_files $uri $uri/ /get.php$is_args$args;

        location ~ ^/media/theme_customization/.*\.xml { deny all; }

        location ~ ^/(.*\.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2))$ {
            add_header Cache-Control "public";
            add_header X-Frame-Options "SAMEORIGIN";
            expires +1y;
            log_not_found off;
            access_log off;
            add_header ETag "";
            add_header Access-Control-Allow-Origin "www.DOMAIN_TLD, cdn.DOMAIN_TLD";

            try_files $uri $uri/ /get.php$is_args$args;
        }
        location ~ ^/(.*\.(zip|gz|gzip|bz2|csv|xml))$ {
            add_header Cache-Control "no-store";
            add_header X-Frame-Options "SAMEORIGIN";
            expires    off;
            log_not_found off;
            access_log off;
            add_header ETag "";
            add_header Access-Control-Allow-Origin "www.DOMAIN_TLD, cdn.DOMAIN_TLD";

            try_files $uri $uri/ /get.php$is_args$args;
        }
        add_header X-Frame-Options "SAMEORIGIN";
    }

    location /media/customer/ { deny all; }

    location /media/downloadable/ { deny all; }

    location /media/import/ { deny all; }

    location ~ (index|get|static|report|404|503|health_check)\.php(/.*)?$ {
        try_files $uri =404;

        add_header X-Config-By 'ProTech' always;
        add_header X-Processing-Time $request_time always;
        add_header X-Request-ID $request_id always;
        add_header Strict-Transport-Security $hsts_header always;
        add_header X-UA-Compatible 'IE=Edge,chrome=1';
        add_header Link "<$scheme://$http_host$request_uri>; rel=\"canonical\"" always;

        fastcgi_split_path_info ^((?U).+\.php) (/?.+)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_pass "unix:///var/www/vhosts/system/DOMAIN_TLD/php-fpm.sock";
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_index  index.php;

        fastcgi_buffers 1024 4k;

        fastcgi_param  PHP_FLAG  "session.auto_start=off \n suhosin.session.cryptua=off";
        fastcgi_param  PHP_VALUE "memory_limit=756M \n max_execution_time=18000";
        fastcgi_read_timeout 1800s;
        fastcgi_connect_timeout 1800s;

        include /etc/nginx/fastcgi.conf;

    }

    location ~ /$ {
        if (!-e $request_filename){ rewrite ^(/.*)([^/]+/)$ /index.php$is_args$args last; }
    }

    disable_symlinks if_not_owner from=$document_root;

    add_header X-Powered-By PleskLin;
    add_header X-Config-By 'ProTech';

    include "/var/www/vhosts/system/DOMAIN_TLD/conf/vhost_nginx.conf";
}

server {
    listen SERVER_IP:80;

    server_name DOMAIN_TLD;
    server_name www.DOMAIN_TLD;
    server_name ipv4.DOMAIN_TLD;

    return 301 https://$host$request_uri;
}
 
Last edited:
Good morning!

Now understanding that ROOT directive are not allowed or working in Additional nginx directives or includes.
I put the complete lines in /opt/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php

CHANGED: fastcgi_pass "unix:///var/www/vhosts/system/<?php echo $VAR->domain->asciiName ?>/php-fpm.sock";

Now MAGENTO 2.2.2 is running whitout problems on PLESK ONYX with NGINX (not in proxy mode).

The following line I had to comment out because I get an error.
add_header Strict-Transport-Security $hsts_header always;

ERROR: Invalid nginx configuration: nginx: [emerg] unknown "hsts_header" variable nginx: configuration file /etc/nginx/nginx.conf test failed

Many thanks Igo. You saved hours of my life :)
 

Attachments

  • nginxDomainVirtualHost.pdf
    46.9 KB · Views: 59
Good morning!

The following line I had to comment out because I get an error.
add_header Strict-Transport-Security $hsts_header always;

ERROR: Invalid nginx configuration: nginx: [emerg] unknown "hsts_header" variable nginx: configuration file /etc/nginx/nginx.conf test failed

Many thanks Igo. You saved hours of my life :)

to fix header error
you can add next code before server block

Code:
map $scheme $hsts_header {
   https   'max-age=15768000';
}
map $scheme $hsts_is_header {
   https   'max-age=15768000; includeSubDomains; preload';
}
server  {
 ..........
...........
}

or
in /etc/nginx/conf.d/ you simply need create file hsts.conf with content
Code:
map $scheme $hsts_header {
   https   'max-age=15768000';
}
map $scheme $hsts_is_header {
   https   'max-age=15768000; includeSubDomains; preload';
}

more detailed info you can find in

PLESK reaches the stars with only Nginx + HSTS (390%)
 
Last edited:
Good morning!

Now understanding that ROOT directive are not allowed or working in Additional nginx directives or includes.
I put the complete lines in /opt/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php

CHANGED: fastcgi_pass "unix:///var/www/vhosts/system/<?php echo $VAR->domain->asciiName ?>/php-fpm.sock";

Now MAGENTO 2.2.2 is running whitout problems on PLESK ONYX with NGINX (not in proxy mode).

The following line I had to comment out because I get an error.
add_header Strict-Transport-Security $hsts_header always;

ERROR: Invalid nginx configuration: nginx: [emerg] unknown "hsts_header" variable nginx: configuration file /etc/nginx/nginx.conf test failed

Many thanks Igo. You saved hours of my life :)

Thank you WapMedia :)
It helps me too to get a good configuration from Magento 2 with Plesk.
 
Thanks to all replays :)
Is someone can summarize all above? I can't understand what needs to be done in template files to make it work. I am not plesk expert :)
 
Good morning!

Now understanding that ROOT directive are not allowed or working in Additional nginx directives or includes.
I put the complete lines in /opt/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php

CHANGED: fastcgi_pass "unix:///var/www/vhosts/system/<?php echo $VAR->domain->asciiName ?>/php-fpm.sock";

Now MAGENTO 2.2.2 is running whitout problems on PLESK ONYX with NGINX (not in proxy mode).

The following line I had to comment out because I get an error.
add_header Strict-Transport-Security $hsts_header always;

ERROR: Invalid nginx configuration: nginx: [emerg] unknown "hsts_header" variable nginx: configuration file /etc/nginx/nginx.conf test failed

Many thanks Igo. You saved hours of my life :)

Hi, i am in a quite similar situation, want to set directives like map (for magento multistore) but cannot due to errors in plesk "additional nginx directives" field.
As far as i can understand what you have done is that you use global file /opt/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php and set there your nginx directives,
but: if i have different customers on my Linux / Plesk server than everything is valid globally

My Question:
can someone tell me where to put directives correctly, so that i can set directives for each server block .. for example two magento installations with different settings.
not globally .. locally..?
 
After reading over reading about how to have Magento 2 working on Plesk still haven't found a solution:

i have modified no template and with these additional Ngix directive Magento (proxy mode tuned off PHP 7.0.27 FPM application served by ngix) frontend is working also the various pages with permalink, the issue remain the admin panel that show a Ngix 404 not found (going to /frontName variable defined in /app/etc/env.php)

these are my directives:
Code:
set $MAGE_ROOT "/var/www/vhosts/mysubdomain.tld/demo";
set $MAGE_MODE default; # or production or developer

#root $MAGE_ROOT/pub;

index index.php;
autoindex off;
charset off;

add_header 'X-Content-Type-Options' 'nosniff';
add_header 'X-XSS-Protection' '1; mode=block';

location /setup {
    root $MAGE_ROOT;
    location ~ ^/setup/index.php {
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }

    location ~ ^/setup/(?!pub/). {
        deny all;
    }

    location ~ ^/setup/pub/ {
        add_header X-Frame-Options "SAMEORIGIN";
    }
}

location /update {
    root $MAGE_ROOT;

    location ~ ^/update/index.php {
        fastcgi_split_path_info ^(/update/index.php)(/.+)$;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  PATH_INFO        $fastcgi_path_info;
        include        fastcgi_params;
    }

    # deny everything but index.php
    location ~ ^/update/(?!pub/). {
        deny all;
    }

    location ~ ^/update/pub/ {
        add_header X-Frame-Options "SAMEORIGIN";
    }
}

location / { try_files $uri $uri/ /index.php$is_args$args; }

location ~ /$ {
    if (!-e $request_filename){ rewrite ^(/.*)([^/]+/)$ /index.php$is_args$args last; }
}

location /pub {
    location ~ ^/pub/media/(downloadable|customer|import|theme_customization/.*\.xml) {
        deny all;
    }
    alias $MAGE_ROOT/pub;
    add_header X-Frame-Options "SAMEORIGIN";
}

location /static/ {
    if ($MAGE_MODE = "production") {
        expires max;
    }
    location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
        add_header Cache-Control "public";
        add_header X-Frame-Options "SAMEORIGIN";
        expires +1y;

        if (!-f $request_filename) {
            rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
        }
    }
    location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
        add_header Cache-Control "no-store";
        add_header X-Frame-Options "SAMEORIGIN";
        expires    off;

        if (!-f $request_filename) {
            rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
        }
    }
    if (!-f $request_filename) {
        rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
    }
    add_header X-Frame-Options "SAMEORIGIN";
}

location /media/ {
    try_files $uri $uri/ /get.php?$args;

    location ~ ^/media/theme_customization/.*\.xml {
        deny all;
    }

    location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
        add_header Cache-Control "public";
        add_header X-Frame-Options "SAMEORIGIN";
        expires +1y;
        try_files $uri $uri/ /get.php?$args;
    }
    location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
        add_header Cache-Control "no-store";
        add_header X-Frame-Options "SAMEORIGIN";
        expires    off;
        try_files $uri $uri/ /get.php?$args;
    }
    add_header X-Frame-Options "SAMEORIGIN";
}

location /media/customer/ {
    deny all;
}

location /media/downloadable/ {
    deny all;
}

location /media/import/ {
    deny all;
}

location ~ cron\.php {
    deny all;
}

location ~ (index|get|static|report|404|503|health_check)\.php(/.*)?$ {
    try_files $uri =404;

    fastcgi_param  PHP_FLAG  "session.auto_start=off \n suhosin.session.cryptua=off";
    fastcgi_param  PHP_VALUE "memory_limit=256M \n max_execution_time=600";
    fastcgi_read_timeout 600s;
    fastcgi_connect_timeout 600s;
    fastcgi_param  MAGE_MODE $MAGE_MODE;

    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    include        fastcgi_params;
}

can someone can point me out to a solution to get also the admin panel working?

EDIT1:
Finally seems i've solved all issues replacing in my ngix directives:
Code:
location / { try_files $uri $uri/ /index.php$is_args$args; }

location ~ /$ {
    if (!-e $request_filename){ rewrite ^(/.*)([^/]+/)$ /index.php$is_args$args last; }
}
with
Code:
if (!-e $request_filename){ rewrite ^(/.*)([^/]+/)$ /index.php$is_args$args last; }

location / {
    try_files $uri $uri/ /index.php$is_args$args;
}

EDIT2: i was having issues with 404 on some js files ... solved with this solution
Magento2 cannot resolve path to pub/static JS files · Issue #7869 · magento/magento2 · GitHub
 
Last edited:
@FrancYescO I tried your config in the nginx directives in Plesk and I got the pages to load but I am unable to figure out how to get the static files like css png jpg and js files to load. Attached is a file containing the nginx config. I contact Plesk for support and they told me to contact Magento. Their support is a joke even though I pay for the license directly.

Any help would be appreciated.
 

Attachments

  • nginx.pdf
    53.3 KB · Views: 44
@FrancYescO I tried your config in the nginx directives in Plesk and I got the pages to load but I am unable to figure out how to get the static files like css png jpg and js files to load. Attached is a file containing the nginx config. I contact Plesk for support and they told me to contact Magento. Their support is a joke even though I pay for the license directly.

Any help would be appreciated.
please pay attention to your links
your config incorrect
you missed /httpdocs in path
set $MAGE_ROOT "/var/www/vhosts/demo.cctvcameraworld.com/";

set $MAGE_ROOT "/var/www/vhosts/demo.cctvcameraworld.com/httpdocs";
root $MAGE_ROOT/pub;

please check your config and fix
 
Last edited:
Hello from Germany,

I have a nginxDomainVirtualHost.php template working up to MAGENTO CE 2.3.2 with PHP7.2 and NGINX (native) on Plesk ONYX Version 17.8.11.

Now trying to use the AWS CloudFront from this example.
Improve Magento 2 performance with AWS CloudFront

Media files working like charme but static content delivers a 502 on the aws side.
Hope anybody can help.

Regardes
Christian
 

Attachments

  • magento_aws.zip
    152.6 KB · Views: 16
Back
Top