Skip to content

Commit ea88af2

Browse files
committed
Create nginx.conf.template
1 parent bf4b6c4 commit ea88af2

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
upstream docker_codeigniter {
2+
server codeigniter: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/appstarter/public;
34+
index index.php;
35+
36+
location / {
37+
try_files $uri /index.php$is_args$args;
38+
}
39+
40+
location ~* \.php$ {
41+
fastcgi_pass docker_codeigniter;
42+
fastcgi_index index.php;
43+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
44+
include fastcgi_params;
45+
}
46+
#
47+
# deny access to .htaccess vb. files, if Apache's document root
48+
location ~/\. {
49+
deny all;
50+
log_not_found off;
51+
}
52+
#
53+
location ~* \.(svg|svgz)$ {
54+
types {}
55+
default_type image/svg+xml;
56+
}
57+
location = /favicon.ico {
58+
log_not_found off;
59+
access_log off;
60+
}
61+
location = /robots.txt {
62+
allow all;
63+
log_not_found off;
64+
access_log off;
65+
}
66+
#
67+
# set expiration of assets to MAX for caching
68+
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
69+
expires max;
70+
log_not_found off;
71+
}
72+
#
73+
access_log off;
74+
error_log /var/log/nginx/${NGINX_HOST}.error.log error;
75+
}

0 commit comments

Comments
 (0)