ISPConfig with Nginx Proxy rewrite problem.

Discussion in 'Installation/Configuration' started by simonfr, Dec 4, 2015.

  1. simonfr

    simonfr New Member

    Hi all,
    I'm trying since some days to resolve problems with my website. It's based on Zend Framework 2. I'm using ISPConfig Perfect Server for Debian 8 with Nginx Proxy with this tutorial :

    My website have all his content in folder /plugins/. When I'm trying to access to it works great but when I'm trying to access to I see only index.php without style.css. I've tried to access I get 404 error but when I'm trying to It works.

    Here is my .htaccess :
    SetEnv APPLICATION_ENV development
    # Set the charset of the output
    AddDefaultCharset UTF-8
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/pdf "access plus 1 month"
    ExpiresByType text/x-javascript "access plus 1 month"
    ExpiresByType application/x-shockwave-flash "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 year"
    ExpiresDefault "access plus 2 days"
    RewriteEngine On
    # Exclude some directories from URI rewriting
    #RewriteRule ^(dir1|dir2|dir3) - [L]
    RewriteRule ^(chat|svn) - [L]
    RewriteRule ^\.htaccess$ - [F]
    RewriteCond %{REQUEST_URI} =""
    RewriteRule ^.*$ /public/index.php [NC,L]
    RewriteCond %{REQUEST_URI} !^/public/.*$
    RewriteRule ^(.*)$ /public/$1
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^public/.*$ /public/index.php [NC,L]
    And here my default vhost from NGINX :
    server {
            listen   80 default;
            server_name  _;
            server_name_in_redirect  off;
            access_log  /var/log/ispconfig/httpd/$host/access.log;
            location ~* ^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|b$
                    root   /var/www/$host/web;
                    access_log off;
                    expires 30d;
            location / {
                    root    /var/www/$host/web;
                    index  index.html index.htm index.php;
                    access_log      off;
                    proxy_set_header X-Real-IP  $remote_addr;
                    proxy_set_header Host $host;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    server {
            server_name XXX.XXX.XXX.XXX;
            add_header X-Frame-Options "SAMEORIGIN";
            return 301 $scheme://$request_uri;
    Can you help me to resolve this ?
    Best regards,
    Thank you

Share This Page