[vpsFree.cz: community-list] Nginx ipv6 trable

Lukas Nemec lu.nemec at gmail.com
Wed Oct 30 14:44:58 CET 2013


Ahoj,

mam to takto:

server {
listen 80;
server_name domena.com;

dalsi veci ...
}

Z manualu nginx je to vypsane nasledovne:

pokud mam linux a je nastaveno v sysctl.conf |net.ipv6.bindv6only=0 
(default)
tak to posloucha na v4 i v6....

pro BSD a pokud nastavim moznost vyse na 1, tak musim bindovat v4 a v6 
zvlast tak jak napsal
Petr ...

pokud neprehodis moznost bindv6only=1, tak ten tvuj config bude chcipat 
na bind() already in use ..


Zkousel jsem oboje, i s pripsanym obojim v configu, a vetsinou byla 
stranka dostupna na v6, ale v4 me hazela na jinou hostovanou domenu ...

Muj config na kterem to testuju (includuje se z hlavniho):
bindipv6only=1

server {
     listen 80;
     listen [::]:80;
     server_name www.nemec.lu;

     rewrite ^.*$ http://nemec.lu/ permanent;
}

server {
     listen 80 default_server;
     listen [::]:80 default_server;
     client_max_body_size 2G;

     server_name nemec.lu;

     access_log /home/nginx/wysiwyg/access.log;
     error_log /home/nginx/wysiwyg/error.log;

     location / {
        include uwsgi_params;
        root /home/lukas/wysiwyg;
        uwsgi_pass 127.0.0.1:3030;
     }

     # force to use https for /admin
     location /admin/ {
         rewrite "^(.*)" https://$host$1 permanent;
     }

     location /media/ {
         alias /home/nginx/wysiwyg/media/;
         access_log off;
         expires 7d;
         autoindex on;
     }

     location  /static/ {
         alias  /home/nginx/wysiwyg/static/;
         access_log off;
         expires 7d;
     }
}

server {
     listen 443 ssl default_server;
     listen [::]:443 ssl default_server;
     client_max_body_size 2G;

     ssl_certificate /etc/nginx/cert/server.crt;
     ssl_certificate_key /etc/nginx/cert/server.key;

     server_name nemec.lu www.nemec.lu;

     access_log /home/nginx/wysiwyg/access.log;
     error_log /home/nginx/wysiwyg/error.log;

     location / {
        include uwsgi_params;
        root /home/lukas/wysiwyg;
        uwsgi_pass 127.0.0.1:3030;
     }

     location /media/ {
         alias /home/nginx/wysiwyg/media/;
         access_log off;
         expires 7d;
     }

     location  /static/ {
         alias  /home/nginx/wysiwyg/static/;
         access_log off;
         expires 7d;
     }


Dikec,

Lukas Nemec
|
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vpsfree.cz/pipermail/community-list/attachments/20131030/abdca843/attachment-0002.html>


More information about the Community-list mailing list