Last active
February 13, 2019 08:24
-
-
Save marcorieser/0d48922acb9192225b2a49031abc22bc to your computer and use it in GitHub Desktop.
Laravel Valet project nginx.conf which serves remote upload files if they do not exist localy.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name project.test www.project.test *.project.test; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443 ssl http2; | |
server_name project.test www.project.test *.project.test; | |
root /; | |
charset utf-8; | |
client_max_body_size 128M; | |
location /41c270e4-5535-4daa-b23e-c269744c2f45/ { | |
internal; | |
alias /; | |
try_files $uri $uri/; | |
} | |
ssl_certificate "/Users/johndoe/.config/valet/Certificates/project.test.crt"; | |
ssl_certificate_key "/Users/johndoe/.config/valet/Certificates/project.test.key"; | |
location / { | |
rewrite ^ "/Users/johndoe/.composer/vendor/laravel/valet/server.php" last; | |
} | |
access_log off; | |
error_log "/Users/johndoe/.config/valet/Log/nginx-error.log"; | |
error_page 404 "/Users/johndoe/.composer/vendor/laravel/valet/server.php"; | |
set $production https://project.ch; | |
set $rootFolder '/Users/johndoe/websites/project/public/'; | |
location ~ "^/wp-content/uploads/(.*)$" { | |
expires 24h; | |
log_not_found off; | |
root $rootFolder; | |
if (-f $request_filename) { | |
break; | |
} | |
try_files $uri $uri/ @production; | |
} | |
location @production { | |
resolver 8.8.8.8; | |
proxy_pass $production/$uri; | |
} | |
location ~ \.php$ { | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass "unix:/Users/johndoe/.config/valet/valet.sock"; | |
fastcgi_index "/Users/johndoe/.composer/vendor/laravel/valet/server.php"; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME "/Users/johndoe/.composer/vendor/laravel/valet/server.php"; | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
} | |
server { | |
listen 60; | |
server_name project.test www.project.test *.project.test; | |
root /; | |
charset utf-8; | |
client_max_body_size 128M; | |
location /41c270e4-5535-4daa-b23e-c269744c2f45/ { | |
internal; | |
alias /; | |
try_files $uri $uri/; | |
} | |
location / { | |
rewrite ^ "/Users/johndoe/.composer/vendor/laravel/valet/server.php" last; | |
} | |
access_log off; | |
error_log "/Users/johndoe/.config/valet/Log/nginx-error.log"; | |
error_page 404 "/Users/johndoe/.composer/vendor/laravel/valet/server.php"; | |
location ~ \.php$ { | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass "unix:/Users/johndoe/.config/valet/valet.sock"; | |
fastcgi_index "/Users/johndoe/.composer/vendor/laravel/valet/server.php"; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME "/Users/johndoe/.composer/vendor/laravel/valet/server.php"; | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment