mirror of
https://github.com/snibox/snibox.git
synced 2026-04-26 00:06:12 +03:00
[GH-ISSUE #26] enable cors with specified host #27
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/snibox#27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @anxiaoyi on GitHub (Jul 24, 2018).
Original GitHub issue: https://github.com/snibox/snibox/issues/26
I deployed snibox to machine A, I have a nginx server deployed in machine B (https://machine-b-host.com). now I want to visit snibox by request the url (https://machine-b-host.com/snibox) by using nginx proxy_pass. Now, the GET request works well, but the /login POST request cannot works. seems like the snibox backend gives me a 422 status code, cause of the default CORS rejected policy.
I want to add my host (https://machine-b-host.com) to the CORS whitelist, so let the POST request works.
So which config should edit ? Thanks.
@piv-pav commented on GitHub (Nov 2, 2018):
First of all that would be nice to see the configuration you are currently running on yours
nginx, and rails logs according this422response to at least understand why's that. I believe that might happed due to your snibox installation is using base URI/snibox, however you app ignores that fact and sending post request to/logininstead of/snibox/login.I'd try few options here:
RAILS_RELATIVE_URL_ROOTenvironment variable to/snibox. You can do it using either.envfile (check .env.production.sample) or using commandRAILS_RELATIVE_URL_ROOT=/snibox rails serverto start rails, or any other way provided by the method you starting your application (likeEnvironmentparameter inside SystemD unit file)config.rufile to look like thisAnyway this is my
nginxconfig for proxying requests to the snibox running inside docker container which is working fine, however I don't use custom base URI for snibox:@vavgustov commented on GitHub (Jan 29, 2019):
no response - closed as deprecated