Tweak nginx config#52
Conversation
|
I hope it is okay if I apply your changes speratly as I'd like to keep an overview over all lines and am not sure about all lines:
|
Sure, that was the idea.
It's more secure to add this in the server config, because this is harder to compromise and it doesn't depend on PHP.
This is now covered by
All HTTP requests are rewritten to HTTPS, so acme challenge would be blocked. |
| return 301 https://$host$request_uri; | ||
| } | ||
| # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. | ||
| return 301 https://$server_name$request_uri; |
There was a problem hiding this comment.
Thanks for the hint, that makes sense. Maybe a comment on this would be helpful to other users, that $host have security issues and $server_name should be used when only one URL is in use ?
There was a problem hiding this comment.
Ah, thanks. I didn't notice that this was also changed.
Can you quickly describe me a use case where this would make it more secure?
If I understand it correctly $host takes the Host: header and $server_name the first domain specified in the nginx block.
So as long people don't use Matomo as the default_server it shouldn't matter as the Host as to match anyway. But if they do (which they shouldn't), an attacker could fake the $host ,right?
No description provided.