Skip to content

Commit c9a40f9

Browse files
committed
Create nginx.conf.template
1 parent 7d99293 commit c9a40f9

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
upstream docker_cakephp {
2+
server cakephp:9000;
3+
}
4+
5+
server {
6+
listen ${NGINX_PORT} default_server;
7+
listen [::]:${NGINX_PORT} ipv6only=on default_server;
8+
#
9+
server_name ${NGINX_HOST} www.${NGINX_HOST};
10+
#
11+
location ~ ^/.well-known/acme-challenge/ {
12+
root /tmp/acme-challenge;
13+
}
14+
#
15+
#location / {
16+
#port_in_redirect off;
17+
#return 301 https://$host$request_uri;
18+
#}
19+
}
20+
21+
server {
22+
#listen 443 ssl http2;
23+
#listen [::]:443 ipv6only=on ssl http2;
24+
#
25+
server_name ${NGINX_HOST} www.${NGINX_HOST};
26+
#
27+
#ssl_certificate /etc/letsencrypt/live/${NGINX_HOST}/fullchain.pem;
28+
#ssl_certificate_key /etc/letsencrypt/live/${NGINX_HOST}/privkey.pem;
29+
#ssl_trusted_certificate /etc/letsencrypt/live/${NGINX_HOST}/chain.pem;
30+
#ssl_dhparam /etc/letsencrypt/ssl-dhparam.pem;
31+
include /etc/letsencrypt/options-ssl-nginx.conf;
32+
33+
root /var/www/html;
34+
index index.php;
35+
36+
location / {
37+
try_files $uri /index.php$is_args$args;
38+
}
39+
40+
location ~ \.php$ {
41+
try_files $uri =404;
42+
include fastcgi_params;
43+
fastcgi_pass docker_cakephp;
44+
fastcgi_index index.php;
45+
fastcgi_intercept_errors on;
46+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
47+
}
48+
#
49+
# deny access to .htaccess vb. files, if Apache's document root
50+
location ~/\. {
51+
deny all;
52+
log_not_found off;
53+
}
54+
#
55+
location ~ /.well-known {
56+
allow all;
57+
}
58+
#
59+
location = /favicon.ico {
60+
log_not_found off;
61+
access_log off;
62+
}
63+
#
64+
location = /robots.txt {
65+
allow all;
66+
log_not_found off;
67+
access_log off;
68+
}
69+
#
70+
access_log off;
71+
error_log /var/log/nginx/${NGINX_HOST}.error.log error;
72+
}

0 commit comments

Comments
 (0)