Nginx setup for Wiki.js

    • OMV 4.x
    • Nginx setup for Wiki.js

      Hi,
      I'm having troubles setting up nginx config for wiki.js. I am running the beta (version 2.0.0-beta.275) on a docker container. So far I've tried to use the official documentation on nginx - but it won't work. Maybe it is because the documentation is for the previous version (version 1.0.117)

      This is from the official doc:

      Source Code

      1. server {
      2. listen 80;
      3. listen [::]:80;
      4. server_name wiki.example.com;
      5. location / {
      6. proxy_set_header Host $http_host;
      7. proxy_set_header X-Real-IP $remote_addr;
      8. proxy_pass http://127.0.0.1:3001;
      9. proxy_http_version 1.1;
      10. proxy_set_header Upgrade $http_upgrade;
      11. proxy_set_header Connection "upgrade";
      12. proxy_next_upstream error timeout http_502 http_503 http_504;
      13. }
      14. }
      Display All

      Has anyone had experience with setting it up?
    • hi, why you don't enter with https?, anyway

      Source Code

      1. server {
      2. listen 80;
      3. server_name _;
      4. proxy_redirect off;
      5. location / {
      6. rewrite /(.*) /$1 break;
      7. proxy_http_version 1.1;
      8. proxy_set_header Upgrade $http_upgrade;
      9. proxy_set_header Connection $connection_upgrade;
      10. proxy_pass http://ip:port/;
      11. proxy_set_header Host $host;
      12. proxy_redirect http://ip:port/ /;
      13. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      14. proxy_set_header X-Forwarded-Server $host;
      15. proxy_set_header X-Forwarded-Host $host;
      16. proxy_set_header X-Real-IP $remote_addr;
      17. proxy_set_header X-Forwarded-Proto $scheme;
      18. }
      19. }
      Display All
    • Giancky79 wrote:

      hi, why you don't enter with https?, anyway

      Source Code

      1. server {
      2. listen 80;
      3. server_name _;
      4. proxy_redirect off;
      5. location / {
      6. rewrite /(.*) /$1 break;
      7. proxy_http_version 1.1;
      8. proxy_set_header Upgrade $http_upgrade;
      9. proxy_set_header Connection $connection_upgrade;
      10. proxy_pass http://ip:port/;
      11. proxy_set_header Host $host;
      12. proxy_redirect http://ip:port/ /;
      13. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      14. proxy_set_header X-Forwarded-Server $host;
      15. proxy_set_header X-Forwarded-Host $host;
      16. proxy_set_header X-Real-IP $remote_addr;
      17. proxy_set_header X-Forwarded-Proto $scheme;
      18. }
      19. }
      Display All

      I tried it just now, and it doesn't seem to work.
      So what I'd like the path to be is mydomain.com/wiki.
    • Source Code

      1. upstream proxmox {
      2. server "FQDN HOSTNAME";
      3. }
      4. server {
      5. listen 80 default_server;
      6. rewrite ^(.*) https://$host$1 permanent;
      7. }
      8. server {
      9. listen 443;
      10. server_name _;
      11. ssl on;
      12. ssl_certificate /etc/pve/local/pve-ssl.pem;
      13. ssl_certificate_key /etc/pve/local/pve-ssl.key;
      14. proxy_redirect off;
      15. location / {
      16. proxy_http_version 1.1;
      17. proxy_set_header Upgrade $http_upgrade;
      18. proxy_set_header Connection "upgrade";
      19. proxy_pass https://localhost:8006;
      20. proxy_buffering off;
      21. client_max_body_size 0;
      22. proxy_connect_timeout 3600s;
      23. proxy_read_timeout 3600s;
      24. proxy_send_timeout 3600s;
      25. send_timeout 3600s;
      26. }
      27. }
      Display All
      This is my configuration for nginx and proxmox, but i use https, inside nginx you use letsencrypt certificate? and on router you open the port 80 and 443 with ip port of your OMV machine?
    • Source Code

      1. map $http_upgrade $connection_upgrade {
      2. '' 'close';
      3. default 'upgrade';
      4. }
      5. server {
      6. listen 443 ssl;
      7. server_name _;
      8. add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
      9. ssl on;
      10. ssl_certificate /etc/letsencrypt/live/nome-scelto-server/fullchain.pem;
      11. ssl_certificate_key /etc/letsencrypt/live/nome-scelto-server/privkey.pem;
      12. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
      13. ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:!aNULL:!eNULL:!EXP$
      14. ssl_prefer_server_ciphers on;
      15. ssl_session_cache shared:SSL:10m;
      16. ssl_session_timeout 5m;
      17. proxy_buffering off;
      18. location / {
      19. rewrite /(.*) /$1 break;
      20. proxy_http_version 1.1;
      21. proxy_set_header Upgrade $http_upgrade;
      22. proxy_set_header Connection $connection_upgrade;
      23. proxy_pass http://ip:port/;
      24. proxy_set_header Host $host;
      25. proxy_redirect http://ip:port/ /;
      26. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      27. proxy_set_header X-Forwarded-Server $host;
      28. proxy_set_header X-Forwarded-Host $host;
      29. proxy_set_header X-Real-IP $remote_addr;
      30. proxy_set_header X-Forwarded-Proto $scheme;
      31. proxy_connect_timeout 3600s;
      32. proxy_read_timeout 3600s;
      33. proxy_send_timeout 3600s;
      34. send_timeout 3600s;
      35. }
      36. location /destination-name/ {
      37. rewrite /destination-name/(.*) /$1 break;
      38. proxy_http_version 1.1;
      39. proxy_set_header Upgrade $http_upgrade;
      40. proxy_set_header Connection $connection_upgrade
      41. proxy_pass http://ip:port/;
      42. proxy_set_header Host $host;
      43. proxy_redirect http://ip:port/ /;
      44. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      45. proxy_set_header X-Forwarded-Server $host;
      46. proxy_set_header X-Forwarded-Host $host;
      47. proxy_set_header X-Real-IP $remote_addr;
      48. proxy_set_header X-Forwarded-Proto $scheme;
      49. proxy_connect_timeout 3600s;
      50. proxy_read_timeout 3600s;
      51. proxy_send_timeout 3600s;
      52. send_timeout 3600s;
      53. }
      54. }
      Display All
      this one in case you have one address with multiple under address

      The post was edited 1 time, last by Giancky79 ().

    • Giancky79 wrote:

      Source Code

      1. upstream proxmox {
      2. server "FQDN HOSTNAME";
      3. }
      4. server {
      5. listen 80 default_server;
      6. rewrite ^(.*) https://$host$1 permanent;
      7. }
      8. server {
      9. listen 443;
      10. server_name _;
      11. ssl on;
      12. ssl_certificate /etc/pve/local/pve-ssl.pem;
      13. ssl_certificate_key /etc/pve/local/pve-ssl.key;
      14. proxy_redirect off;
      15. location / {
      16. proxy_http_version 1.1;
      17. proxy_set_header Upgrade $http_upgrade;
      18. proxy_set_header Connection "upgrade";
      19. proxy_pass https://localhost:8006;
      20. proxy_buffering off;
      21. client_max_body_size 0;
      22. proxy_connect_timeout 3600s;
      23. proxy_read_timeout 3600s;
      24. proxy_send_timeout 3600s;
      25. send_timeout 3600s;
      26. }
      27. }
      Display All
      This is my configuration for nginx and proxmox, but i use https, inside nginx you use letsencrypt certificate? and on router you open the port 80 and 443 with ip port of your OMV machine?
      Yes I use letsencrypt certificate and yes I have both ports 80 and 443 open. I have nginx working properly for sonarr and radarr so I know that the issue is with wiki.js.
    • Giancky79 wrote:

      Source Code

      1. map $http_upgrade $connection_upgrade {
      2. '' 'close';
      3. default 'upgrade';
      4. }
      5. server {
      6. listen 443 ssl;
      7. server_name _;
      8. add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
      9. ssl on;
      10. ssl_certificate /etc/letsencrypt/live/nome-scelto-server/fullchain.pem;
      11. ssl_certificate_key /etc/letsencrypt/live/nome-scelto-server/privkey.pem;
      12. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
      13. ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:!aNULL:!eNULL:!EXP$
      14. ssl_prefer_server_ciphers on;
      15. ssl_session_cache shared:SSL:10m;
      16. ssl_session_timeout 5m;
      17. proxy_buffering off;
      18. location / {
      19. rewrite /(.*) /$1 break;
      20. proxy_http_version 1.1;
      21. proxy_set_header Upgrade $http_upgrade;
      22. proxy_set_header Connection $connection_upgrade;
      23. proxy_pass http://ip:port/;
      24. proxy_set_header Host $host;
      25. proxy_redirect http://ip:port/ /;
      26. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      27. proxy_set_header X-Forwarded-Server $host;
      28. proxy_set_header X-Forwarded-Host $host;
      29. proxy_set_header X-Real-IP $remote_addr;
      30. proxy_set_header X-Forwarded-Proto $scheme;
      31. proxy_connect_timeout 3600s;
      32. proxy_read_timeout 3600s;
      33. proxy_send_timeout 3600s;
      34. send_timeout 3600s;
      35. }
      36. location /destination-name/ {
      37. rewrite /destination-name/(.*) /$1 break;
      38. proxy_http_version 1.1;
      39. proxy_set_header Upgrade $http_upgrade;
      40. proxy_set_header Connection $connection_upgrade
      41. proxy_pass http://ip:port/;
      42. proxy_set_header Host $host;
      43. proxy_redirect http://ip:port/ /;
      44. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      45. proxy_set_header X-Forwarded-Server $host;
      46. proxy_set_header X-Forwarded-Host $host;
      47. proxy_set_header X-Real-IP $remote_addr;
      48. proxy_set_header X-Forwarded-Proto $scheme;
      49. proxy_connect_timeout 3600s;
      50. proxy_read_timeout 3600s;
      51. proxy_send_timeout 3600s;
      52. send_timeout 3600s;
      53. }
      54. }
      Display All
      this one in case you have one address with multiple under address
      This still doesn't work for me...