initial commit
This commit is contained in:
10
docker/nginx/Dockerfile
Normal file
10
docker/nginx/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM nginx
|
||||
|
||||
COPY ./public /var/www/app/public
|
||||
|
||||
# gz encode builded files
|
||||
|
||||
RUN gzip -9 -k -f -r /var/www/app/public/build/*
|
||||
|
||||
COPY ./docker/nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||
|
71
docker/nginx/default.conf
Normal file
71
docker/nginx/default.conf
Normal file
@@ -0,0 +1,71 @@
|
||||
upstream phpfcgi {
|
||||
server php:9000;
|
||||
# server unix:/var/run/php5-fpm.sock; #for PHP-FPM running on UNIX socket
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
# only for getting traffic from collabora, when opening nginx:8001
|
||||
listen 8001;
|
||||
|
||||
#server_name symfony4;
|
||||
root /var/www/app/public;
|
||||
|
||||
error_log /dev/stderr;
|
||||
access_log /dev/stdout main;
|
||||
|
||||
location / {
|
||||
index index.php;
|
||||
try_files $uri /index.php$is_args$args;
|
||||
}
|
||||
|
||||
location /build/ {
|
||||
expires 30d;
|
||||
add_header Pragma public;
|
||||
add_header Cache-Control "public";
|
||||
|
||||
gzip_static on;
|
||||
gzip_types
|
||||
application/atom+xml
|
||||
application/geo+json
|
||||
application/javascript
|
||||
application/x-javascript
|
||||
application/json
|
||||
application/ld+json
|
||||
application/manifest+json
|
||||
application/rdf+xml
|
||||
application/rss+xml
|
||||
application/xhtml+xml
|
||||
application/xml
|
||||
font/eot
|
||||
font/otf
|
||||
font/ttf
|
||||
image/svg+xml
|
||||
text/css
|
||||
text/javascript
|
||||
text/plain
|
||||
text/xml;
|
||||
}
|
||||
|
||||
location ~ ^/index\.php(/|$) {
|
||||
fastcgi_pass phpfcgi;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||
include fastcgi_params;
|
||||
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param DOCUMENT_ROOT $document_root;
|
||||
fastcgi_param HTTPS off;
|
||||
|
||||
fastcgi_buffers 16 16k;
|
||||
fastcgi_buffer_size 32k;
|
||||
proxy_buffer_size 16k;
|
||||
proxy_busy_buffers_size 16k;
|
||||
|
||||
http2_push_preload on;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
return 404;
|
||||
}
|
||||
}
|
82
docker/nginx/nginx.with-collabora.conf
Normal file
82
docker/nginx/nginx.with-collabora.conf
Normal file
@@ -0,0 +1,82 @@
|
||||
user nginx;
|
||||
worker_processes 1;
|
||||
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /dev/stdout main;
|
||||
error_log /dev/stderr;
|
||||
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
gzip off;
|
||||
|
||||
#include /etc/nginx/conf.d/*.conf;
|
||||
|
||||
# permet l'upload de fichiers
|
||||
client_max_body_size 3M;
|
||||
|
||||
upstream phpfcgi {
|
||||
server php:9000;
|
||||
# server unix:/var/run/php5-fpm.sock; #for PHP-FPM running on UNIX socket
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen 8001;
|
||||
|
||||
#server_name symfony4;
|
||||
root /var/www/app/public;
|
||||
|
||||
error_log /dev/stderr;
|
||||
access_log /dev/stdout main;
|
||||
|
||||
location / {
|
||||
index index.php;
|
||||
try_files $uri /index.php$is_args$args;
|
||||
}
|
||||
|
||||
location /build/ {
|
||||
expires 30d;
|
||||
add_header Pragma public;
|
||||
add_header Cache-Control "public";
|
||||
}
|
||||
|
||||
location ~ ^/index\.php(/|$) {
|
||||
fastcgi_pass phpfcgi;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||
include fastcgi_params;
|
||||
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param DOCUMENT_ROOT $document_root;
|
||||
fastcgi_param HTTPS off;
|
||||
|
||||
fastcgi_buffers 16 16k;
|
||||
fastcgi_buffer_size 32k;
|
||||
proxy_buffer_size 16k;
|
||||
proxy_busy_buffers_size 16k;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user