WordPress Website not rendered properly via nginx reverse proxy
Nikolaos Milas
nmilas at noa.gr
Tue Oct 15 13:33:05 UTC 2024
Hello,
We are using nginx on a server as a reverse proxy and it works fine
serving multiple websites.
Now I am trying to reverse proxy another one, a WP website, in the same
way, but it won't render correctly.
I can only see the main page areas and only some text at some places,
but most content, including images, is missing.
What may be wrong?
I have checked error logs but I don't see anything logged.
Any suggestions will be most appreciated.
In the config below, the original site (http://example.private.noa.gr)
works without issues (it is rendered properly), but the proxied one
(https://example.noa.gr) does not.
Here is the config:
===========================================================
server {
listen 80;
listen [::]:80;
server_name example.noa.gr;
return 301 https://example.noa.gr/$request_uri;
access_log /var/log/example_http_access_log main;
error_log /var/log/example_http_error_log warn;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name example.noa.gr;
allow 127.0.0.1;
allow ::1;
allow 10.10.0.0/16;
deny all;
ssl_certificate /etc/pki/tls/certs/star_noa_gr_cert-current.crt;
ssl_certificate_key /etc/pki/tls/private/star_noa_gr-1243437.key;
access_log /var/log/example_https_access_log main;
error_log /var/log/example_https_error_log warn;
client_max_body_size 50M;
location / {
proxy_pass http://example.private.noa.gr:80/;
proxy_set_header Host example.private.noa.gr;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Server $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_buffer_size 16k;
proxy_max_temp_file_size 2048m;
proxy_buffers 8 16k;
}
}
===========================================================
(Note: the buffer directives were added to avoid the "an upstream
response is buffered to a temporary file" error.)
Thanks in advance.
Best regards,
Nick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4466 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20241015/ff82e06a/attachment.bin>
More information about the nginx
mailing list