I'm using Nginx as a proxy with Apache2 behind it. The current config works and I can access the site. However, the PHP application is build on Zend Framework 2 and relies on urls in /controller/action/ structure and these does not get passed to Apache2. This results that every link from the homepage to subpages is broken and redirects to our "Page not found"-page. The url passed to Apache2 is /index.php instead of /controllerX/actionY
Nginx (VirtualHost) config
server {
listen 80;
root /var/www/talentina_dev/talentina-alpha-temp/public/;
index index.php index.html index.htm;
server_name dev-aws.talentina.com;
location / {
try_files $uri $uri/ /index.php;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8080;
}
location ~ \.php$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8080;
}
location ~ /\.ht {
deny all;
}
}
A requirement is that the initial url is "/" to get to the homepage and I think it's covered with the location / {..} structure. However, since I'm very new to this, I'm open to suggestions.
Big thanks in advance !
UPDATE Adding VirtualHost file from Apache2
<VirtualHost 127.0.0.1:8080>
ServerAdmin ...
ServerName dev-aws.talentina.com
ServerAlias dev-aws.talentina.com
DocumentRoot /var/www/talentina_dev/talentina-alpha-temp/public/
php_value error_reporting 6135
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/talentina_dev/talentina-alpha-temp/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>