alias

Daniel daniel at linux-nerd.de
Mon Oct 24 19:14:27 UTC 2016


hi there,

i try to setup a Alias but it seems not working and i didnt know why:

   server {
        listen 80;
        root /var/www/d1/current/web/;
        server_name localhost;

        location / {
            index app.php;
            add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept";
            add_header Access-Control-Allow-Origin "*";

	        if ($request_uri ~* \.(ico|css|js|gif|jpe?g|png|woff)$) {
                        expires 0;
                        break;
        }
            if (-f $request_filename) {
                break;
            }
            try_files $uri @rewriteapp;
        }

        location @rewriteapp {
            rewrite ^(.*)$ /app.php/$1 last;
        }

	location /en/holidays/shared/images {
                alias /mnt/nfs/uat;
        }

       location ~ ^/proxy\.php(\?|/|$) {
	    fastcgi_pass unix:/var/run/php-fpm/php70u-fpm.sock;
            fastcgi_split_path_info ^(.+\.php)(.*)$;
            include fastcgi_params;
            fastcgi_param SCRIPT_NAME $fastcgi_script_name;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_path_info;
            fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
            fastcgi_buffer_size 128k;
            fastcgi_buffers 4 256k;
            fastcgi_busy_buffers_size 256k;
            add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept";
            add_header Access-Control-Allow-Origin "*";
            # Prevents URIs that include the front controller. This will 404:
            # http://domain.tld/app.php/some-path
            # Remove the internal directive to allow URIs like this
            #internal;

        }

        location ~ ^/app\.php(/|$) {
	    fastcgi_pass unix:/var/run/php-fpm/php70u-fpm.sock;
            fastcgi_split_path_info ^(.+\.php)(/.*)$;
            include fastcgi_params;
            fastcgi_param SCRIPT_NAME $fastcgi_script_name;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_path_info;
            fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
            fastcgi_buffer_size 128k;
            fastcgi_buffers 4 256k;
            fastcgi_busy_buffers_size 256k;
            add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept";
            add_header Access-Control-Allow-Origin "*";

            # Prevents URIs that include the front controller. This will 404:
            # http://domain.tld/app.php/some-path
            # Remove the internal directive to allow URIs like this
            internal;

        }

I added exaclty that:

	location /en/holidays/shared/images {
                alias /mnt/nfs/uat;
        }

but nginx tries to open the files from document root :-(


Anyone any idea what  it could be?

Cheers

Daniel 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20161024/f2820624/attachment.html>


More information about the nginx mailing list