-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Extended nginx config #2565
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
Extended nginx config #2565
Conversation
|
Thanks for contributing, but your configuration is very specific for your installation. Moreover, i believe that for us don't need some production configuration in magento at all, only configuration for development. |
|
@kandy sounds like you dont even understand what are you talking about... that sad to hear, especially when you have incomplete and bad Magento v1 config (yet in manuals, you dont even bother to revise it for few years), and now you have some castrated, childish and incomplete config for Magento v2. even more sad when we take random url from your list of early adopted Magento v2 webshops, and we able to download everything. you will ask why? simple because you as business application developer dont care about its security, even after that fact that Nginx is in your system requirements... we never said this config is perfect or specific, but it is more likely as default config, that is better to use rather than nothing. i would write more, but i guess it is all useless for you. p.s. "you" i mean Magento and Magento employees who should really care about it. so from your words kandy you dont care about security in production, and you dont even care how secure is your development server. you have to be kidding me... answer this question - why do you put .htaccess files everywhere?? then this will be THE answer for all your doubts. cheers |
|
Thanks again for feedback. |
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.
We have control over this header in configuration
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.
maybe is better to send headers like these from the server not from the application. sending headers from application is good for debug or to report some errors with api ,.. etc
|
@magenx thats for this PR. We will review. While we are not expecting anyone to use our sample nginx config for production, I agree this protects even dev environment much better. |
|
guys we just need your input, because Magento 2 is very new, and even this stuff can be all wrong if you look from the other angle. but just to be sure we run on this config from web installation to some admin tasks, looks like there is no major errors. |
nginx/conf.d/extra_protect.conf
Outdated
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.
Why not 403 (or deny all) like with the other sensitive files?
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.
actually as i remember we have been working with firewall , like these 403 can be configured with log scanners like fail2ban and csf firewall and block multiple abusers, where 444 the same, the only difference is that 444 will terminate request immediately and user just gets no response back. need to revise this logic. separate log for 403 errors.
|
Due to internal discussion should be included in Magento |
Do we really want to include that in our distro? Sorry, its a custom decision which may (and will) affect search performance and i would never recommend to do this for the website without strict reason. Can we move all this crap out? |
|
Another note - hhvm is not officially supported, i am not recommending to include it configuration in the git. Its a perfect idea for 3rd party repository (or just a blog post) but i dont think we should include it into the repository until it is officially supported. |
| ~*(Exabot|eCatch|ecxi|EirGrabber|EmailCollector|EmailSiphon|EmailWolf|ExtractorPro|EyeNetIE) 1; | ||
| ~*(FlashGet|Findxbot) 1; | ||
| ~*(GetRight|GetWeb!|Go!Zilla|Go-Ahead-Got-It|Go.*package.*|GrabNet|Grafula|GT::WWW|GuzzleHttp) 1; | ||
| ~*(heritrix|HaosouSpider|HMView|HTTP::Lite|HTTrack) 1; |
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.
this potentially can block some perl/python programs. Why do we need to response with 444 in this case? Also 444 have a special meaning " Used to indicate that the server has returned no information to the client and closed the connection." Why do you want to use this code? It does not look like correct behavior.
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.
can block some perl/python programs.
which one?? when we tested this config few python and java clients where removed, others just a default noisy agents, it is good to keep them out. 444 will save you a lot of resources.
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.
Do we really want to include that in our distro? Sorry, its a custom decision which may (and will) affect search performance and i would never recommend to do this for the website without strict reason. Can we move all this crap out?
lol, if you need search bots to to hit and index all these url wishlist|customer|catalogsearch|newsletter|contact|sendfriend|catalog/product_compare|review/product/post|(fire|one.+)?checkout
go ahead remove it on your server/shop configuration...
|
" which one?? when we tested this config few python and java clients where removed, others just a default noisy agents, it is good to keep them out. 444 will save you a lot of resources." E.g. HTTP::Lite. I dont think that it makes any sense at all. If you will get real ddos - they will use some "real" UA. If it is just some crawlers or integrations - its typically not using a lot of resources. About 444 code please read HTTP RFC before doing such weird things. It is a debugging hell. About buckets for paths - one can just use robots.txt + block bots who not respecting it (not a lot). From my POV - this configs are kind of overcomplicated and are not necessary for the most of the users. Moreover - from my experience most of Magento high load customers do not using such things, because, again, it does not help you to survive real ddos but makes debugging and maintenance much more painful. E.g. if some integration will fall into "bad_client" pattern (very possible) last thing which web developer will check is nginx config. And excluding such requests from log make debugging even harder. So i personally dont see any reason to keep any of this "additional" logic enabled. We can supply them in .conf.extra, which is disabled by default and used only if enabled, just for the users who really needs that. |
|
what ddos?? I wasn't even thinking about ddos protection in nginx, who will ever use nginx for anti-ddos?? there is minimal default protection from excessive requests, which you can easily split to different rules or increase rate as you need. how it makes your debugging even harder?? what exactly falls into "bad_client" pattern ?? when the last time you succeeded with robots.txt, as i know robots.txt rules are not honored even by google bot... |
|
"when the last time you succeeded with robots.txt, as i know robots.txt rules are not honored even by google bot..." |
|
Closing pull request because of too complex logic for the general-use configuration |
|
indeed is too complex... sounds like we trying to create a vaccine against the terrible virus .... |
|
Thank you for your contribution, but we are trying to keep our web server configuration as simple as possible. Also all nginx logic should be equal to the apache one. I would recommend to create an article about your configuration with a github repository, so anyone could use it if needed. |
#2562