-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #151 from TomaszKandula/feat/nginx
feat: nginx
- Loading branch information
Showing
16 changed files
with
483 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# See https://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
|
||
# testing | ||
/coverage | ||
/reports | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
__testrun.dev.sh | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# sonar qube | ||
/.sonarqube | ||
/.scannerwork |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM debian:latest | ||
WORKDIR /usr/share/nginx/html | ||
|
||
RUN rm -rf ./* | ||
RUN apt-get update | ||
RUN apt-get upgrade | ||
RUN apt-get -y install bash | ||
RUN apt-get -y install nginx | ||
RUN apt-get -y install nginx-full | ||
RUN apt-get -y install nginx-extras | ||
RUN adduser --system --no-create-home --shell /bin/false --group --disabled-login nginx | ||
RUN chown -R nginx:nginx /var/www/html | ||
|
||
CMD /bin/bash -c "nginx -t" | ||
CMD /bin/bash -c "nginx -g 'daemon off;'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
include /etc/nginx/modules-enabled/*.conf; | ||
|
||
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 /var/log/nginx/access.log main; | ||
|
||
sendfile on; | ||
#tcp_nopush on; | ||
server_tokens off; | ||
more_clear_headers Server; | ||
|
||
keepalive_timeout 65; | ||
|
||
gzip on; | ||
gzip_static on; | ||
gzip_disable "msie6"; | ||
gzip_proxied any; | ||
gzip_buffers 16 8k; | ||
gzip_http_version 1.1; | ||
gzip_min_length 256; | ||
gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon; | ||
gunzip on; | ||
|
||
server { | ||
listen 80; | ||
server_name ${SERVER_NAME}; | ||
|
||
error_page 404 /404.html; | ||
location = /404.html { | ||
root /usr/share/nginx/html; | ||
} | ||
|
||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html$is_args$args; | ||
|
||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_connect_timeout 90; | ||
proxy_send_timeout 90; | ||
proxy_read_timeout 90; | ||
proxy_buffering off; | ||
proxy_cache_valid 200 30m; | ||
proxy_cache_valid 404 1m; | ||
|
||
client_max_body_size 10m; | ||
client_body_buffer_size 128k; | ||
} | ||
|
||
location /api { | ||
proxy_pass http://backend; | ||
} | ||
|
||
location /hc { | ||
proxy_pass http://backend/hc; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
include /etc/nginx/modules-enabled/*.conf; | ||
|
||
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 /var/log/nginx/access.log main; | ||
|
||
sendfile on; | ||
#tcp_nopush on; | ||
server_tokens off; | ||
more_clear_headers Server; | ||
|
||
keepalive_timeout 65; | ||
|
||
gzip on; | ||
gzip_static on; | ||
gzip_disable "msie6"; | ||
gzip_proxied any; | ||
gzip_buffers 16 8k; | ||
gzip_http_version 1.1; | ||
gzip_min_length 256; | ||
gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon; | ||
gunzip on; | ||
|
||
server { | ||
listen 443 ssl; | ||
server_name ${SERVER_NAME}; | ||
|
||
ssl_certificate /etc/nginx/wildcard-emailsender.dev.chain; | ||
ssl_certificate_key /etc/nginx/wildcard-emailsender.dev.key; | ||
ssl_trusted_certificate /etc/nginx/wildcard-emailsender.dev.ca; | ||
|
||
ssl_session_cache shared:le_nginx_SSL:10m; | ||
ssl_session_timeout 1d; | ||
ssl_session_cache shared:MozSSL:10m; | ||
ssl_session_tickets off; | ||
|
||
ssl_dhparam /etc/nginx/ffdhe2048.txt; | ||
|
||
ssl_protocols TLSv1.2 TLSv1.3; | ||
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305; | ||
ssl_prefer_server_ciphers off; | ||
|
||
ssl_stapling on; | ||
ssl_stapling_verify on; | ||
|
||
add_header Strict-Transport-Security "max-age=63072000" always; | ||
access_log /var/log/nginx/access.log; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html$is_args$args; | ||
|
||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_connect_timeout 90; | ||
proxy_send_timeout 90; | ||
proxy_read_timeout 90; | ||
proxy_buffering off; | ||
proxy_cache_valid 200 30m; | ||
proxy_cache_valid 404 1m; | ||
|
||
client_max_body_size 10m; | ||
client_body_buffer_size 128k; | ||
} | ||
|
||
location /api { | ||
proxy_pass http://backend; | ||
} | ||
|
||
location /hc { | ||
proxy_pass http://backend/hc; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
include /etc/nginx/modules-enabled/*.conf; | ||
|
||
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 /var/log/nginx/access.log main; | ||
|
||
sendfile on; | ||
#tcp_nopush on; | ||
server_tokens off; | ||
more_clear_headers Server; | ||
|
||
keepalive_timeout 65; | ||
|
||
gzip on; | ||
gzip_static on; | ||
gzip_disable "msie6"; | ||
gzip_proxied any; | ||
gzip_buffers 16 8k; | ||
gzip_http_version 1.1; | ||
gzip_min_length 256; | ||
gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon; | ||
gunzip on; | ||
|
||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
error_page 404 /404.html; | ||
location = /404.html { | ||
root /usr/share/nginx/html; | ||
} | ||
|
||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html$is_args$args; | ||
|
||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_connect_timeout 90; | ||
proxy_send_timeout 90; | ||
proxy_read_timeout 90; | ||
proxy_buffering off; | ||
proxy_cache_valid 200 30m; | ||
proxy_cache_valid 404 1m; | ||
|
||
client_max_body_size 10m; | ||
client_body_buffer_size 128k; | ||
} | ||
|
||
location /api { | ||
proxy_pass http://backend; | ||
} | ||
|
||
location /hc { | ||
proxy_pass http://backend/hc; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.