-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
357a534
commit 01ddbde
Showing
4 changed files
with
75 additions
and
0 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,14 @@ | ||
FROM nginx:1.18-alpine | ||
|
||
MAINTAINER Damien Retzinger <damien@graycore.io> | ||
|
||
RUN apk update && apk add openssl | ||
RUN mkdir /etc/nginx/certs \ | ||
&& echo -e "\n\n\n\n\n\n\n" | openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/certs/nginx.key -out /etc/nginx/certs/nginx.crt | ||
|
||
COPY ./conf/nginx.conf /etc/nginx/ | ||
COPY ./conf/default.conf /etc/nginx/conf.d/ | ||
|
||
EXPOSE 8443 | ||
|
||
WORKDIR /var/www/html |
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,19 @@ | ||
upstream fastcgi_backend { | ||
server magento2:9000; | ||
} | ||
|
||
server { | ||
listen 8000; | ||
return 301 https://$host$request_uri; | ||
} | ||
|
||
server { | ||
listen 8443 ssl; | ||
|
||
ssl_certificate /etc/nginx/certs/nginx.crt; | ||
ssl_certificate_key /etc/nginx/certs/nginx.key; | ||
|
||
set $MAGE_ROOT /var/www/html; | ||
|
||
include /var/www/html/nginx[.]conf; | ||
} |
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 @@ | ||
worker_processes 2; | ||
|
||
error_log /var/log/nginx/error.log debug; | ||
|
||
events { | ||
|
||
} | ||
|
||
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; | ||
|
||
keepalive_timeout 60; | ||
|
||
gzip on; | ||
|
||
include /etc/nginx/conf.d/*.conf; | ||
} |
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 @@ | ||
## This ngninx configuration should serve as an example for a production configuration of nginx. | ||
## Do note that this configuration only serves non-encrypted connections. This is intentional; | ||
## traffic within the DMZ should not need to be encrypted unless absolutely required. | ||
|
||
server { | ||
listen 8000; | ||
|
||
set $MAGE_ROOT /var/www/html; | ||
|
||
include /var/www/html/nginx[.]conf; | ||
} | ||
|
||
# upstream fastcgi_backend { | ||
# server magento2:9001; | ||
# } |