Comments (5)
Hi @narenarora I'm not an nginx expert unfortunately :(
I tried to reproduce the issue, without Docker though, on script-server.net and everything worked fine for me.
I used 1.18 version build
This is my nginx config:
location ^~ /test-nginx/ {
proxy_pass_header Server;
proxy_set_header Host $proxy_host;
proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Scheme $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:5000/;
# needed for websockets
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Origin http://$proxy_host;
}
from script-server.
I even tried it with docker:
sudo docker run -d -p 5001:5000 bugy/script-server:1.18.0
location ^~ /test-nginx-docker/ {
proxy_pass_header Server;
proxy_set_header Host $proxy_host;
proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Scheme $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:5001/;
# needed for websockets
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Origin http://$proxy_host;
}
Still works fine :(
from script-server.
Thank you @bugy for trying this out. Would you be able to try it with your reverse proxy and script server running on different hosts? That's the only difference I can think of between your setup and mine.
Meanwhile, I will try to move my container to the same host that has my proxy and see if it works there.
Feel free to call out if none of this makes sense. I am guessing it has something to do with $proxy_host
and 127.0.0.1
essentially being the same in your case. So maybe the Host
and Origin
proxy headers have some play here when the proxy_pass
is to a non-local location.
Edit : Not a proxy / nginx expert either. Just guessing.
from script-server.
Incase this is where the issue is, below is my conf.json
{
"port": 5000,
"address": "0.0.0.0",
"title": "My Script Server",
"auth": {
"type": "htpasswd",
"htpasswd_path": "/auth/.htpasswd"
},
"access": {
"admin_users": [ "admin" ]
},
"callbacks": {
"notify_on_start": false,
"notify_on_finish": true,
"notification_fields": [ "execution_id", "script_name", "user", "audit_command", "exit_code" ],
"destinations": [
{
"type": "http",
"url": "http://ntfy/topic"
}
]
},
"logging": {
"execution_file": "$DATE-$ID.log",
"execution_date_format": "%y-%m-%d_%H-%M"
},
"security": {
"xsrf_protection": "token"
}
}
from script-server.
If this helps .. this is my redirection log. Looks like once it hits index.html
, it is internally redirected to /login.html
without the subpath
$ curl -vL https://mydomain.com/myscripts 2>&1 | grep -i location
< location: https://mydomain.com/myscripts/
< location: http://mydomain.com/login.html?next=%2Fmyscripts%2F
< Location: https://mydomain.com/login.html?next=%2Fmyscripts%2F
I did try to run the script-server container on the same host as the proxy, but same issue. All the proxy configs I have seen in the issues seem to be proxy running on the host directly, so http://127.0.0.1:5000
is a valid location. Since I have my proxy running as a container, 127.0.0.1
doesn't apply.
Using a subdomain works, as expected. But I'd really like to find a solution for this using a subpath.
from script-server.
Related Issues (20)
- show ScriptServer version in UI context or config.json HOT 2
- Feature request: support target="_blank" for links in terminal output HOT 2
- Executing an ansible playbook with user + password requires the parameter "same_arg_param" HOT 2
- regex for allowed_users? HOT 1
- How can i block the user input when running a script? HOT 2
- Error trying to use 'requires_terminal' when running as a systemd daemon HOT 3
- Hide some options for non-admin users HOT 1
- How do you use this to run docker commands? HOT 7
- Feature request: support clean shutdown also on SIGTERM HOT 2
- I'm having some issues with deployment HOT 1
- Add a second level/group in side panel to allow for more organized script grouping HOT 1
- feature(auth): Azure AD OAuth HOT 2
- Feature: GUI edit runners in subdirs of /conf/runners/<directory>/script.json
- Kubernetes ingress/nginx example
- 拒绝执行,这还需改哪里的设置? HOT 1
- Cant SSH from script HOT 2
- Provide config option for ldaps trusted CA HOT 1
- Question: Disable stop of running script HOT 7
- Is that anyway to add env variable into server_file file_dir? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from script-server.