Skip to content

Apache with Nginx Reverse Proxy #1698

@ghost

Description

I am currently using Apache 2.4 with a Nginx 1.4.6 as a Reverse Proxy. It seems my setup doesn't work properly with rewrites. I got a 404 error when going to admin page and other pages except for homepage that works fine.

Here is my Apache config vhost file

<VirtualHost *:*>
    ServerName magento2.dev
    ServerAlias www.magento2.dev
    ServerAdmin support@etd.me
    DocumentRoot /home/magento2_dev/public_html
    ErrorLog /home/magento2_dev/logs/apache2/error.log
    CustomLog /home/magento2_dev/logs/apache2/access.log combined

    <Directory "/home/magento2_dev/public_html">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
        Allow from all
    </Directory>

</VirtualHost>`

And my Nginx vhost config file

server {
    listen 80;
    listen [::]:80;

    root /home/magento2_dev/public_html;
    index index.php index.html index.htm;

    server_name magento2.dev www.magento2.dev;

    location ~ \.php$ {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;
    }

    location ~ /\. {
        deny all;
    }

    access_log /home/magento2_dev/logs/nginx/access.log;
    error_log /home/magento2_dev/logs/nginx/error.log;

}

any clues how I can fix this ? :)

NOTE: I have apache mod rewrite on

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions