README 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. Catster
  2. -------
  3. A simple django application to that shows cute cats purring only on ipv6.
  4. Users trying to view purring cats via ipv4 will be shown a message that the
  5. website only serves cats to ipv6 client.
  6. To view the application first install the dependencies:
  7. ```
  8. make install-deps
  9. ```
  10. To run application:
  11. ```
  12. make server
  13. ```
  14. To run the tests:
  15. ```
  16. make tests
  17. ```
  18. ## Notes:
  19. While this is solved with django mechanism. The "ipv4 only" page can simply be
  20. served with nginx listening on 0.0.0.0 and serving a static page, while another
  21. server directive can listen on ipv6 and transfer the traffic to the uwsgi server.
  22. ```
  23. server {
  24. listen [::]:80 ipv6only=on;
  25. server_name catster.info;
  26. location / {
  27. root /var/www/localhost/;
  28. index index.html index.htm;
  29. }
  30. }
  31. server {
  32. listen 0.0.0.0:80;
  33. server_name catster.info;
  34. location / {
  35. root /var/www/localhost/nocats;
  36. index index.html index.htm;
  37. }
  38. }
  39. ```
  40. Another approach using nginx is also demonstrated in the ungleich blog ...
  41. https://ungleich.ch/en-us/cms/blog/2019/01/27/how-to-distinguish-ipv6-and-ipv4-traffic-with-nginx/