Bez popisu

Oz N Tiram 4345ebf161 rename README to README.md před 5 roky
catster 51bd13b7df Initial commit před 5 roky
.gitignore 2c6399cf9d Initial commit před 5 roky
LICENSE 2c6399cf9d Initial commit před 5 roky
Makefile 51bd13b7df Initial commit před 5 roky
Pipfile 51bd13b7df Initial commit před 5 roky
README.md 4345ebf161 rename README to README.md před 5 roky
manage.py 51bd13b7df Initial commit před 5 roky

README.md

Catster

A simple django application to that shows cute cats purring only on ipv6. Users trying to view purring cats via ipv4 will be shown a message that the website only serves cats to ipv6 client.

To view the application first install the dependencies:

make install-deps

To run application:

make server

To run the tests:

make tests

Notes:

While this is solved with django mechanism. The "ipv4 only" page can simply be served with nginx listening on 0.0.0.0 and serving a static page, while another server directive can listen on ipv6 and transfer the traffic to the uwsgi server.

         server {
         listen          [::]:80 ipv6only=on;
         server_name     catster.info;
         location / {
             root   /var/www/localhost/;
             index  index.html index.htm;
             }
        }

         server {
         listen          0.0.0.0:80;
         server_name     catster.info;
         location / {
             root   /var/www/localhost/nocats;
             index  index.html index.htm;
             }
        }

Another approach using nginx is also demonstrated in the ungleich blog ... https://ungleich.ch/en-us/cms/blog/2019/01/27/how-to-distinguish-ipv6-and-ipv4-traffic-with-nginx/