-
-
Notifications
You must be signed in to change notification settings - Fork 607
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
Fix #352 - Block PHP scripts in Nginx for uploads #356
Conversation
@@ -1,5 +1,10 @@ | |||
# {{ ansible_managed }} | |||
|
|||
# Prevent php scripts from being executed inside the uploads folder. | |||
location ~* /app/uploads/.*\.php$ { | |||
deny all; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use 2 spaces instead of 4
done and done! i shouldn't have did this on my master branch though....right? i should have made a feature branch? |
@erikbelusic yeah you probably have created a branch but it's not a big deal. You can always re-create your fork. One more thing: we usually like to keep PRs to a single commit (unless there's a reason for more) to keep our Git history clean. Would you be able to squash these two commits into one? We can provide instructions if you haven't done it before. Although I just realized that's the best reason to do work on a feature branch since you need to force push after a rebase/squash and obviously you should avoid that on |
@swalkinshaw i have not done it before. please provide guidance =] |
@swalkinshaw i think i got it. let me know if it turned out correctly. |
Fix #352 - Block PHP scripts in Nginx for uploads
@erikbelusic perfect! Thanks. |
@swalkinshaw now that this has been merged, can i delete and refork to make any additional contributions on feature branches without messing this up? |
@erikbelusic yep I'd definitely do that. |
@erikbelusic No need to delete. Assuming you named the upstream (this remote)
|
Prevent php scripts from being accessed or executed inside the app/uploads folder and any subdirectories by adding an nginx directive to the wordpress.conf.
This has been tested to return a 403 error for any file with a
.php
extension in app/uploads or any subdirectory of uploads. Assets with any other extension are not affected and can be accessed as normal.