mirror of
https://github.com/laravel/valet.git
synced 2026-02-06 00:40:06 +01:00
fix nginx support
This commit is contained in:
committed by
Adam Wathan
parent
6f61b840f1
commit
fba8eb7602
@@ -1,32 +0,0 @@
|
||||
import VALET_HOME_PATH/Caddy/*
|
||||
|
||||
:80 {
|
||||
root /
|
||||
|
||||
# Slight hack, see: https://github.com/mholt/caddy/issues/1020
|
||||
internal /dev/null
|
||||
|
||||
fastcgi / 127.0.0.1:9000 php {
|
||||
index VALET_SERVER_PATH
|
||||
}
|
||||
|
||||
rewrite {
|
||||
to VALET_SERVER_PATH?{query}
|
||||
}
|
||||
|
||||
log VALET_HOME_PATH/Log/access.log {
|
||||
rotate {
|
||||
size 10
|
||||
age 3
|
||||
keep 1
|
||||
}
|
||||
}
|
||||
|
||||
errors {
|
||||
log VALET_HOME_PATH/Log/error.log {
|
||||
size 10
|
||||
age 3
|
||||
keep 1
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
http://VALET_SITE:80 {
|
||||
redir https://{host}{uri}
|
||||
}
|
||||
|
||||
https://VALET_SITE:443 {
|
||||
root /
|
||||
|
||||
# Slight hack, see: https://github.com/mholt/caddy/issues/1020
|
||||
internal /dev/null
|
||||
|
||||
tls VALET_CERT VALET_KEY
|
||||
|
||||
fastcgi / 127.0.0.1:9000 php {
|
||||
index VALET_SERVER_PATH
|
||||
}
|
||||
|
||||
rewrite {
|
||||
to VALET_SERVER_PATH?{query}
|
||||
}
|
||||
|
||||
log VALET_HOME_PATH/Log/access.log {
|
||||
rotate {
|
||||
size 10
|
||||
age 3
|
||||
keep 1
|
||||
}
|
||||
}
|
||||
|
||||
errors {
|
||||
log VALET_HOME_PATH/Log/error.log {
|
||||
size 10
|
||||
age 3
|
||||
keep 1
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>com.laravel.valetServer</string>
|
||||
<key>WorkingDirectory</key>
|
||||
<string>VALET_PATH</string>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>./bin/caddy</string>
|
||||
<string>--conf=VALET_HOME_PATH/Caddyfile</string>
|
||||
</array>
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
<key>StandardErrorPath</key>
|
||||
<string>/tmp/com.laravel.valetServer.err</string>
|
||||
</dict>
|
||||
</plist>
|
||||
20
cli/stubs/fastcgi_params
Normal file
20
cli/stubs/fastcgi_params
Normal file
@@ -0,0 +1,20 @@
|
||||
fastcgi_param QUERY_STRING $query_string;
|
||||
fastcgi_param REQUEST_METHOD $request_method;
|
||||
fastcgi_param CONTENT_TYPE $content_type;
|
||||
fastcgi_param CONTENT_LENGTH $content_length;
|
||||
fastcgi_param SCRIPT_FILENAME $request_filename;
|
||||
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
fastcgi_param DOCUMENT_URI $document_uri;
|
||||
fastcgi_param DOCUMENT_ROOT $document_root;
|
||||
fastcgi_param SERVER_PROTOCOL $server_protocol;
|
||||
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
|
||||
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
|
||||
fastcgi_param REMOTE_ADDR $remote_addr;
|
||||
fastcgi_param REMOTE_PORT $remote_port;
|
||||
fastcgi_param SERVER_ADDR $server_addr;
|
||||
fastcgi_param SERVER_PORT $server_port;
|
||||
fastcgi_param SERVER_NAME $server_name;
|
||||
fastcgi_param HTTPS $https if_not_empty;
|
||||
fastcgi_param REDIRECT_STATUS 200;
|
||||
fastcgi_param HTTP_PROXY "";
|
||||
41
cli/stubs/nginx.conf
Normal file
41
cli/stubs/nginx.conf
Normal file
@@ -0,0 +1,41 @@
|
||||
user VALET_USER staff;
|
||||
worker_processes auto;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
gzip on;
|
||||
gzip_comp_level 5;
|
||||
gzip_min_length 256;
|
||||
gzip_proxied any;
|
||||
gzip_vary on;
|
||||
|
||||
gzip_types
|
||||
application/atom+xml
|
||||
application/javascript
|
||||
application/json
|
||||
application/rss+xml
|
||||
application/vnd.ms-fontobject
|
||||
application/x-font-ttf
|
||||
application/x-web-app-manifest+json
|
||||
application/xhtml+xml
|
||||
application/xml
|
||||
font/opentype
|
||||
image/svg+xml
|
||||
image/x-icon
|
||||
text/css
|
||||
text/plain
|
||||
text/x-component;
|
||||
|
||||
include VALET_HOME_PATH/Nginx/*;
|
||||
include servers/*;
|
||||
include valet/valet.conf;
|
||||
}
|
||||
44
cli/stubs/secure.valet.conf
Normal file
44
cli/stubs/secure.valet.conf
Normal file
@@ -0,0 +1,44 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name VALET_SITE;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name VALET_SITE;
|
||||
root /;
|
||||
charset utf-8;
|
||||
|
||||
location /static/ {
|
||||
internal;
|
||||
alias /;
|
||||
try_files $uri $uri/;
|
||||
}
|
||||
|
||||
ssl_certificate VALET_CERT;
|
||||
ssl_certificate_key VALET_KEY;
|
||||
|
||||
location / {
|
||||
rewrite ^ VALET_SERVER_PATH?$query_string last;
|
||||
}
|
||||
|
||||
location = /favicon.ico { access_log off; log_not_found off; }
|
||||
location = /robots.txt { access_log off; log_not_found off; }
|
||||
|
||||
access_log off;
|
||||
error_log VALET_HOME_PATH/Log/nginx-error.log;
|
||||
|
||||
error_page 404 VALET_SERVER_PATH;
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_pass unix:VALET_HOME_PATH/valet.sock;
|
||||
fastcgi_index VALET_SERVER_PATH;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
server {
|
||||
listen 80;
|
||||
listen 80 default_server;
|
||||
root /;
|
||||
charset utf-8;
|
||||
|
||||
@@ -25,35 +25,7 @@ server {
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_pass unix:VALET_HOME_PATH/valet.sock;
|
||||
fastcgi_index VALET_SERVER_PATH;
|
||||
|
||||
fastcgi_param QUERY_STRING $query_string;
|
||||
fastcgi_param REQUEST_METHOD $request_method;
|
||||
fastcgi_param CONTENT_TYPE $content_type;
|
||||
fastcgi_param CONTENT_LENGTH $content_length;
|
||||
|
||||
fastcgi_param SCRIPT_FILENAME $request_filename;
|
||||
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
fastcgi_param DOCUMENT_URI $document_uri;
|
||||
fastcgi_param DOCUMENT_ROOT $document_root;
|
||||
fastcgi_param SERVER_PROTOCOL $server_protocol;
|
||||
|
||||
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
|
||||
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
|
||||
|
||||
fastcgi_param REMOTE_ADDR $remote_addr;
|
||||
fastcgi_param REMOTE_PORT $remote_port;
|
||||
fastcgi_param SERVER_ADDR $server_addr;
|
||||
fastcgi_param SERVER_PORT $server_port;
|
||||
fastcgi_param SERVER_NAME $server_name;
|
||||
|
||||
fastcgi_param HTTPS $https if_not_empty;
|
||||
|
||||
# PHP only, required if PHP was built with --enable-force-cgi-redirect
|
||||
fastcgi_param REDIRECT_STATUS 200;
|
||||
|
||||
fastcgi_param HTTP_PROXY "";
|
||||
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
|
||||
Reference in New Issue
Block a user