-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
NGINX: 405 Method Not allowed when using OPTIONS request to "/" vs "index.php" #89
Comments
Hello, For my application / needs this solved the issue: # Have NGINX try searching for PHP files as well
location / {
try_files $uri /index.php?$query_string;
} So basically when you access / location it will redirect user to index.php with GET parameters included. |
To add to this, I did more research to see what the industry is doing. Digital Ocean acquired an NGINX configuration generator: https://www.digitalocean.com/community/tools/nginx?domains.0.php.phpServer=127.0.0.1%3A9000 In their example, have their config exactly how I have it (which I've seen in many other examples too). I'm hesitant to remove Thoughts? |
Thank you so much for diving in deep on this and publishing official resources to reference. I am going to ping @danpastori on this to review, but unfortunately he's quite tied up right now. The next free moment he has I have some Laravel specific questions on why we're not able to experience this issue in Laravel. We appreciate your patience and dedication to resolving this the right way in an issue that's deep into the web application stack 😃 Possible workaroundIn your own image, I wonder if you could try using |
Affected Docker Images
*-fpm-nginx
Current Behavior
When an
OPTIONS
request is made to a URL NOT ending in.php
, a "405 Method Not Allowed" is returned.Expected Behavior
When making an
OPTIONS
request, it should return a "200".Steps To Reproduce
cores-issue
branch for latest code: https://github.com/jaydrogers/docker-php-test-app/tree/cors-issuedocker compose up
to bring up the containersRequest to
http://localhost
Result is
405
.Request to
http://localhost/index.php
Result is
200
.Host Operating System
N/A
Docker Version
Anything else?
This issue was originally reported by @zigazajc007 via Discord.
Possible causes
Possible solutions
Hesitations on solutions
It seems these might be quite "hacky". Would love to open this up to the community for further discussion on a stable solution.
The text was updated successfully, but these errors were encountered: