1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-05 08:30:07 +01:00

Improve security by listening on 127.0.0.1 only

Fixes #772

I've been using this config change since Aug 17, 2019, without any negative side-effects.
All Valet services continue to work properly, and Valet Share still works just as expected.

If someone were to have a challenge with it, there's an easy downgrade: just remove the `127.0.0.1:` from these files, and run `valet tld test` to rebuild the individual site configs. Or just manually edit the `~/.config/valet/Nginx` site file manually.
This commit is contained in:
Chris Brown
2019-09-07 17:44:19 -04:00
parent b14ce74087
commit fcd73d73bc
2 changed files with 4 additions and 4 deletions

View File

@@ -1,11 +1,11 @@
server { server {
listen 80; listen 127.0.0.1:80;
server_name VALET_SITE www.VALET_SITE *.VALET_SITE; server_name VALET_SITE www.VALET_SITE *.VALET_SITE;
return 301 https://$host$request_uri; return 301 https://$host$request_uri;
} }
server { server {
listen 443 ssl http2; listen 127.0.0.1:443 ssl http2;
server_name VALET_SITE www.VALET_SITE *.VALET_SITE; server_name VALET_SITE www.VALET_SITE *.VALET_SITE;
root /; root /;
charset utf-8; charset utf-8;
@@ -43,7 +43,7 @@ server {
} }
server { server {
listen 60; listen 127.0.0.1:60;
server_name VALET_SITE www.VALET_SITE *.VALET_SITE; server_name VALET_SITE www.VALET_SITE *.VALET_SITE;
root /; root /;
charset utf-8; charset utf-8;

View File

@@ -1,5 +1,5 @@
server { server {
listen 80 default_server; listen 127.0.0.1:80 default_server;
root /; root /;
charset utf-8; charset utf-8;
client_max_body_size 128M; client_max_body_size 128M;