aios
(Dave)
August 20, 2016, 1:50pm
1
Migrating all my Laravel projects. Any body can help with file example?
on nginx it’s look like:
server {
listen 80;
server_name example.com;
root /srv/public;
index index.php index.html index.htm;
access_log /var/log/nginx/osr-access.log;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php {
try_files $uri /index.php =404;
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
proxy_send_timeout 180s;
proxy_read_timeout 180s;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
Best regards to CaddyServer. And sorry for bad english.
UPD
In principle, the file came from the example for wordpress, but perhaps there is a way right?
twaambo
(Twaambo)
August 22, 2016, 7:10am
2
This should get you started.
example.com {
root ./public
log ./storage/logs/caddy-access.log
errors ./storage/logs/caddy-error.log
fastcgi / 127.0.0.1:9000 php {
index index.php
}
rewrite {
r .*
ext /
to /index.php?{query}
}
}
3 Likes
aios
(Dave)
August 23, 2016, 10:39pm
3
Wow! Nice! Great! Awesome its working!
matt
(Matt Holt)
August 23, 2016, 11:19pm
4
Would you like to add this to the GitHub - caddyserver/examples: OBSOLETE. This repo was for Caddy v1. For v2 and newer, see our forum's wiki category. repository? Try to strip it down as simple as it can be, and I think people will appreciate that.
2 Likes
abiosoft
(Abiola Ibrahim)
August 24, 2016, 9:12am
6
Actually the three lines in rewrite can be shorten to one.
example.com {
root ./public
log ./storage/logs/caddy-access.log
errors ./storage/logs/caddy-error.log
fastcgi / 127.0.0.1:9000 php {
index index.php
}
rewrite {
to {path} {path}/ /index.php?{query}
}
}
2 Likes
I cannot understate how great Caddy is! You rock mholt! I recently got a new job where I am learning PHP. Caddy + PHP is dead simple. I would way rather be using Golang but Caddy makes PHP a bit less of a sacrifice.
1 Like
matt
(Matt Holt)
November 17, 2016, 4:23am
9
Thank you Seth Glad you find it useful.
system
(system)
Closed
February 15, 2017, 4:23am
10
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.