Hi, on apache it was possible to create an alias domain like this Code: Alias /images "/var/www/html/example.com/images" <Directory "/var/www/html/example.cpm/images"> Options FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> This would allow files to be server form example.com/images without the folder actually being in the web route of that domain. Is it possible to do something similar on nginx using ISPConfig as the alias domain feature seems like the same but it does not allow you to add a foldername to the end of the name e.g. example.com/images ?
That's a directory or path alias, not an alias domain. See here on how to create an alias with nginx: https://stackoverflow.com/questions/21399789/nginx-how-to-create-an-alias-url-route so all you need is something like this: location /demo { alias /path/to/root/production/folder/here; } which you add in the nginx directives field of the website.
Hi Till, What does the following line do as it is preventing the alias location to serve any jpg files and keeps showing a 404 error Code: location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ { expires max; log_not_found off; } removing this line allows jpg files to be server from the correct folder. I have the following in the directive so far but this causes the 404 error: Code: location / { try_files $uri $uri/ /index.php?$args; } # Add trailing slash to */wp-admin requests. rewrite /wp-admin$ $scheme://$host$uri/ permanent; location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ { expires max; log_not_found off; } location /images { alias /var/www/clients/client0/web6/images; }
So Why does adding this line stop the alias below is and it starts working after removing it? Does it make a difference what order it is written in?
The order of directives might matter. But you might want to contact the developers of the nginx software if you have questions about how the internals of their software work as this question is not related to ISPConfig.