1
0

fix combined image

This commit is contained in:
Michael Schramm 2022-01-13 16:47:35 +01:00
parent 3ad5c4e86b
commit 4537b35c6b
3 changed files with 52 additions and 12 deletions

View File

@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- fix problem with node-prune on production build
- variable names in examples (https://github.com/ohmyform/ohmyform/issues/134)
- error if /run/nginx already exists (https://github.com/ohmyform/ohmyform/pull/148)
- fix combine images
### Security

View File

@ -67,7 +67,7 @@ EXPOSE 3000
RUN mkdir -p /run/nginx/
RUN touch /usr/src/supervisord.log && chmod 777 /usr/src/supervisord.log
COPY supervisord.conf /etc/supervisord.conf
COPY nginx.conf /etc/nginx/conf.d/ohmyform.conf
COPY nginx.conf /etc/nginx/nginx.conf
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
# CMD [ "yarn", "start:prod" ]

View File

@ -1,15 +1,54 @@
server {
listen 3000;
user nginx;
worker_processes 1;
error_log /dev/stderr debug;
pid /var/run/nginx.pid;
location / {
proxy_pass http://localhost:4000;
proxy_redirect off;
proxy_set_header Host $host;
}
events {
worker_connections 1024;
}
location /graphql {
proxy_pass http://localhost:4100;
proxy_redirect off;
proxy_set_header Host $host;
http {
log_format json_combined escape=json
'{'
'"time_local":"$time_local",'
'"remote_addr":"$remote_addr",'
'"remote_user":"$remote_user",'
'"request":"$request",'
'"status": "$status",'
'"body_bytes_sent":"$body_bytes_sent",'
'"request_time":"$request_time",'
'"http_referrer":"$http_referer",'
'"http_user_agent":"$http_user_agent"'
'}';
access_log /var/log/nginx/access.log json_combined;
server {
listen 3000;
location / {
proxy_pass http://localhost:4000;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /graphql {
proxy_pass http://localhost:4100;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
}