• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

nginx proxy gives 403 for images

mopani

New Pleskian
A few months ago I upgraded to Plesk 12 from Plesk 10 (old server to new server, very smooth process -- well done!).

But I have not been able to solve a problem where the nginx proxy for Apache gives a 403 Forbidden for icons, primarily png files over 1kb it appears.

If I switch off smart proxy in the web hosting parameters, the images show up just fine.

File permissions are correct and consistent through the website directories. Just to be sure, I applied chown -R user:group * from the hosting root. No improvement.

For an example:
www.metatek.org/lib/plugins/wrap/images/note/48/important.png gives 403 Forbidden (nginx)

www.metatek.org/lib/images/interwiki/amazon.de.gif is fine, and most toolbar icons are fine, except for ones over 1kb.

The original site favicon.ico was 1.2kb and wouldn't show up right after migration. I resized it to 894bytes and it worked, no more 403 Forbidden when opening the favicon link directly.

Any suggestions? I like having nginx proxy, this is a very good feature and I would like to keep it for security.
 
I don't find anything useful at all in the nginx logs /var/log/nginx/error.log, access.log, etc.

Nothing interesting or related in /var/www/vhosts/[domain]/logs/error, access, proxy either.
 
Hi mopani,

in most cases, such issues appear with missing, or misconfigured rewrite - rules.

To investigate your specific configuration, please post your configuration files ( apache + nginx ) from "/var/www/vhosts/system/metatek.org/conf/*" and please don't forget the specific additional depending vhosts - files ( apache = "vhost.conf" + "vhost_ssl.conf" / nginx = "vhost_nginx.conf" ). Please post as well any existing ".htaccess" - file from "/var/www/vhosts/metatek.org/httpdocs" ( or where ever your document root for the wiki might be on your server! ) and define the wiki and its version, that you installed on your domain. If you use additional plugins, it would be wise to define them as well.
Some wiki's use as well additional nginx - configuration - files, which would be wise to be included in your next post as well, so that investigations could be done faster.
Be aware, that your configuration can vary if you use php5-fpm as well with your domain - so if you use FastCGI as well, please include your depending configuration file for the domain as well, which you could find at ".../php5/fpm/pool.d/*".


An nginx - configuration - example for "DokuWiki" can be found at "http://wiki.nginx.org/Dokuwiki". ( Please keep in mind, that Plesk already configured some location - definition, depending on your server and domain configurations. You never would use the example 1:1 on your server, if you use Plesk, but it might help to solve your issue, if you have a look at it! ).
More usefull example configurations can be found at: "http://wiki.nginx.org/Configuration"
 
Thanks, those are some helpful thoughts. I'll investigate and post those configs.

I have another dokuwiki instance on this server and it has none of these problems, but it was installed *after* the migration, where this installation was migrated. Gives another point of comparison.
 
mopani, I have encountered the exact same problem. Still haven't figured out how to resolve it other than switching back to Apache, which in my case isn't an option because my VPS can't handle so much traffic as nginx does.

Do you have figured out a solution or what might cause the problem?
 
Back
Top