Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use remote copy of st2web #34

Closed
cognifloyd opened this issue Jun 5, 2017 · 1 comment
Closed

Unable to use remote copy of st2web #34

cognifloyd opened this issue Jun 5, 2017 · 1 comment

Comments

@cognifloyd
Copy link
Member

cognifloyd commented Jun 5, 2017

I have st2-docker installed on a CentOS 7.3 server where I've installed docker. This server is only accessible from within the our corporate LAN. I can access the default webui via a domain name that is mapped to that server's internal IP. However, I can't use a remote copy of st2web. (remote, but still within the corporate lan)

After verifying that the machine with a git clone of st2web can actually access the default webui on docker host, we can't do more than just authenticate with the dockerized st2 in the cloned copy of st2web. (The dev version of st2web is served by gulp.) All of the /api calls complain about a missing header: Cross Site Request Origin Allowed (or something like that).

I tried several permutations of allow_origin in /etc/st2/st2.conf to resolve that:

  • allow_origin = *
  • allow_origin = http://localhost:3000,http://127.0.0.1:3000,https://<local domain>
  • allow_origin = http://localhost:3000,http://127.0.0.1:3000,http://localhost:9101,http://127.0.0.1:9101,https://<local domain>

In the dev copy of st2web, we tried setting the url several different ways. (snippet is in the hosts section of config.js)

url: https://<local domain>:443/api
auth: https://<local domain>:443/auth
url: https://<local domain>:443
api: https://<local domain>:443/api
auth: https://<local domain>:443/auth
url: https://<local domain>:443
url: https://<local domain>:443
auth: true

Auth was successful when both url and auth were specified. api calls were not with any permutation.

I don't need to modify the nginx config do I? I would imagine that st2api would use the allow_origin setting to send the CORS headers. If I were to modify nginx (I haven't tried it), would I need to do something like this: https://enable-cors.org/server_nginx.html

@dzimine
Copy link

dzimine commented Jul 18, 2017

You are on the right path with config.js but YES you'll need to modify the nginx config.

The allow_origin in st2/st2.conf is only applicable when st2 runs in dev mode.

Once you complete this, would you pls post the configuration to the community? replying here will be good enough we'll take it from here.

@arm4b arm4b closed this as completed in 6cc70fd Jul 17, 2020
transhapHigsn pushed a commit to DiligenceVault/st2-docker that referenced this issue Jun 8, 2021
You can find the old deprecated version in `DEPRECATED/all-in-one` branch archive: https://github.com/StackStorm/st2-docker/tree/DEPRECATED/all-in-one

Closes StackStorm#22, closes StackStorm#23, closes StackStorm#26, closes StackStorm#29, closes StackStorm#34, closes StackStorm#41, closes StackStorm#43, closes StackStorm#92, closes StackStorm#112, closes StackStorm#117, closes StackStorm#125, closes StackStorm#133, closes StackStorm#141, closes StackStorm#145, closes StackStorm#151, closes StackStorm#163, closes StackStorm#187,
closes StackStorm#188, closes StackStorm#189, closes StackStorm#190
Closes StackStorm#162, closes StackStorm#138, closes StackStorm#108, closes StackStorm#102, closes StackStorm#65
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants