Answer the question
In order to leave comments, you need to log in
How to make nginx work over IPv6 with multiple domains?
Good day.
I decided to make access to a couple of my domains via IPv6 . To do this, in nginx 0.7.67, built with IPv6 support, running on Debian , I added the following lines, as advised here , and now my config looks like this:
<pre><code class="bash">server {
listen 80 default;
listen [::]:80 default ipv6only=on;
server_name a****y.ch;
access_log /var/log/nginx/a****y.ch.access.log;
location / {
add_header Strict-Transport-Security max-age=31556926;
rewrite ^/(.*) https://a****y.ch/$1;
}
}
server {
listen 443 default;
listen [::]:443 default ipv6only=on;
server_name a****y.ch;
ssl on;
ssl_certificate /var/www/ssl.crt;
ssl_certificate_key /var/www/ssl.key;
access_log /var/log/nginx/a****y.ch.https.access.log;
location / {
root /var/www/a****y.ch;
index index.html;
}
}
server {
listen 80;
listen [::]:80;
server_name ad.a****y.ch;
access_log /var/log/nginx/ad.a****y.ch.https.access.log;
location / {
add_header Strict-Transport-Security max-age=31556926;
rewrite ^/(.*) https://ad.a****y.ch/$1;
}
}
server {
listen 443;
listen [::]:443;
server_name ad.a****y.ch;
ssl on;
ssl_certificate /var/www/ssl.crt;
ssl_certificate_key /var/www/ssl.key;
access_log /var/log/nginx/ad.a****y.ch.https.access.log;
location / {
root /var/www/ad.a****y.ch;
index index.html;
}
location /download {
alias /var/www/ad.a****y.ch;
add_header Content-Disposition "attachment";
}
}
Answer the question
In order to leave comments, you need to log in
SSL enabled on https hosts?
ssl on;
ssl_certificate /path/to/ssl.pem;
ssl_certificate_key /path/to/ssl.key;
ssl_protocols SSLv3 TLSv1;
#TLSv1 уязвим! Но версии выше поддерживаются клиентами слабо.
What operating system? If Linux, then you
listen [::]:80;
can remove it enough listen 80;
, by default ipv6 socket accepts ipv4 traffic.
Yes, post the entire config.
First, you forgot to remove the paths from the config :) so the domain is known.
host ad.a****y.ch
tells me that the domain was not found, check the DNS with the registrar. return 301 https://a****y.ch$request_uri;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question