• 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
  • Please beaware of a breaking change in the REST API on the next Plesk release (18.0.62).
    Starting from Plesk Obsidian 18.0.62, requests to REST API containing the Content-Type header with a media-type directive other than “application/json” will result in the HTTP “415 Unsupported Media Type” client error response code. Read more here

Issue NGINX reverse proxy not responding to IPv6

sdayman

New Pleskian
I'm using Vultr's one-click Plesk installation (gets me a discount). My test site only responds on its IPv4 address.

My Ubuntu 16.04 server has IPv6 configured.
Plesk dashboard is responding to IPv6
If I disable the NGINX reverse proxy and go straight to Apache, it responds to IPv6
ifconfig shows my IPv6 address
I can ping6 my IPv6 address from command line and from home
My Tools & Settings IP addresses only show the IPv4 address.
Trying to add the IPv6 address (Shared) on the same ens3 interface gives me this:
Error: ifmng failed: Execution of /sbin/ip addr add XXXXXXXXX/64 dev ens3 failed with return code 2. Stderr is RTNETLINK answers: File exists
/etc/nginx/plesk.conf.d/server.conf has only the IPv4 address

Given that I know my Plesk installation functions with IPv6, how can I get NGINX to listen to the IPv6 address?
 

Attachments

  • Screen Shot 2018-08-26 at 10.44.10 AM.png
    Screen Shot 2018-08-26 at 10.44.10 AM.png
    47.3 KB · Views: 3
I'm quite new to the whole nginx gig and am having quite a struggle to get a reverse proxy for wordpress working. One of the reasons I need to use a reverse proxy is that I'm hosting sites on my internal server that's only accessible through IPv6 from outside. Since not everyone is using IPv6 yet I have a server accessible through IPv4 outside my network that serves as a reverse proxy for all my other services. It works without any problems for all my other services. The only thing that won't work is wordpress.

My reverse proxy config is as follows:

server {
listen [::]:80;
listen 80;
server_name domain-name;
access_log /var/log/nginx/wordpress.log combined;
error_log /var/log/nginx/wordpress-error.log error;

set $addr "[IPv6 address]";
location ~ / {
proxy_pass http://$addr:80/; # live webiste on IPV4
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
include /etc/nginx/mime.types;

try_files $uri $uri/ /index.php?$args;

}
location ~ \.php$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://$addr:80;

try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;

}
}
I don't know where I went wrong. Once I access the site through the domain name there is no css. No images. Only text and hyperlinks that don't really work. Does anybody have any idea or hint as to where I went wrong? I loads forever and then there are no images and css as mentioned before.

My wordpress server is running nginx, too and the config is as follows:

server {
listen 80 default_server;
listen [::]:80 default_server;

server_name domain-name;

access_log /var/log/nginx/blog-access.log;
error_log /var/log/nginx/blog-error.log;

root /var/www/html/;
index index.php;

location / {
try_files $uri $uri/ /index.php?$args;
}

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
Thank you all in advance.
 
I got a great response from Plesk Support. It turns out that the /etc/network/interfaces file's entry for IPv6 was incompatible. Two ways to fix it:
1) Make sure that IPv6 entry is a static address.
2) Delete that IPv6 entry and let Plesk assign an IPv6 address to that interface. With Vultr, they set aside a range of IPv6 addresses, so I went with this solution.
 
Back
Top