Skip to content

Instantly share code, notes, and snippets.

@randy3k
Last active January 29, 2024 15:44
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save randy3k/8a263cff68031e60e00fb75fce963006 to your computer and use it in GitHub Desktop.
Save randy3k/8a263cff68031e60e00fb75fce963006 to your computer and use it in GitHub Desktop.
octopi/octoprint config for nginx proxy manager
location ~ ^/webcam/(.*) {
rewrite ^/webcam/(.*) /octopi/webcam/$1 redirect;
}
location /octopi/ {
if ($scheme != "https") {
rewrite ^ https://$host$uri permanent;
}
rewrite ^/octopi/(.*)$ /$1 break;
proxy_pass http://192.168.0.167;
proxy_redirect ~^http://192.168.0.167/(.*)$ $scheme://$host/octopi/$1;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Script-Name /octopi;
proxy_http_version 1.1;
client_max_body_size 0;
location /octopi/webcam/ {
rewrite ^/octopi/webcam/(.*)$ /webcam/$1 break;
proxy_pass http://192.168.0.167;
proxy_redirect ~^http://192.168.0.167/(.*)$ $scheme://$host/octopi/$1;
auth_basic "Authorization required";
auth_basic_user_file /data/access/1;
}
}
@aw-jansen
Copy link

@argael did you ever get this working with npm?

@H3adsho0ot
Copy link

If someone is looking for this error - enable CORS in octopi under Settings -> API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment