Last active
January 29, 2024 15:44
-
-
Save randy3k/8a263cff68031e60e00fb75fce963006 to your computer and use it in GitHub Desktop.
octopi/octoprint config for nginx proxy manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
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
@argael did you ever get this working with npm?