Skip to content

Commit

Permalink
Reformat nginx conf jinja2 template
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-ax committed Dec 23, 2023
1 parent 73f6a6e commit 9394169
Showing 1 changed file with 40 additions and 42 deletions.
82 changes: 40 additions & 42 deletions config/templates/app/nginx.conf.j2
Original file line number Diff line number Diff line change
@@ -1,67 +1,65 @@

worker_processes {{ env.NGINX_WORKER_PROCESSES }};
pid /tmp/nginx.pid;
pid /tmp/nginx.pid;
worker_processes {{ env.NGINX_WORKER_PROCESSES }};

daemon off;

{%- if env.DEBUG %}
error_log /dev/stderr debug;
{%- else %}
error_log /dev/stderr {{ env.LOG_LEVEL|lower or 'warn' }};
{%- endif %}

events {
worker_connections {{ env.NGINX_WORKER_CONNECTIONS }};
worker_connections {{ env.NGINX_WORKER_CONNECTIONS }};
}

http {
client_body_temp_path /tmp/client_body;
fastcgi_temp_path /tmp/fastcgi_temp;
proxy_temp_path /tmp/proxy_temp;
scgi_temp_path /tmp/scgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
include /etc/nginx/mime.types;
default_type application/octet-stream;

include /etc/nginx/mime.types;

server_tokens off;
gzip on;
gzip_disable "msie6";
server_tokens off;
client_max_body_size {{ env.NGINX_MAX_BODY_SIZE or '2M' }};

gzip on;
gzip_disable "msie6";
{%- if env.NGINX_MAX_BODY_SIZE %}
client_max_body_size {{ env.NGINX_MAX_BODY_SIZE }};
{%- endif %}
log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" - $request_time '
'x_forwarded_for=$http_x_forwarded_for host=$host '
'$request_id $sent_http_x_request_id';

log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" - $request_time '
'x_forwarded_for=$http_x_forwarded_for host=$host '
'$request_id $sent_http_x_request_id';
client_body_temp_path /tmp/client_body;
fastcgi_temp_path /tmp/fastcgi_temp;
proxy_temp_path /tmp/proxy_temp;
scgi_temp_path /tmp/scgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;

default_type application/octet-stream;
upstream backend {
server 127.0.0.1:29000;
}

upstream backend {
server 127.0.0.1:29000;
}
server {
listen 8080 default_server http2;
listen [::]:8080 default_server http2;

server {
listen 8080 default_server;
listen [::]:8080 default_server;
access_log /dev/stdout main;

access_log /dev/stdout main;
location /api {
include /etc/nginx/uwsgi_params;
uwsgi_pass backend;

location /api {
include /etc/nginx/uwsgi_params;
uwsgi_pass backend;

uwsgi_param Host $host;
uwsgi_param X-Real-IP $remote_addr;
uwsgi_param X-Forwarded-For $proxy_add_x_forwarded_for;
uwsgi_param X-Forwarded-Proto $http_x_forwarded_proto;
}
uwsgi_param Host $host;
uwsgi_param X-Real-IP $remote_addr;
uwsgi_param X-Forwarded-For $proxy_add_x_forwarded_for;
uwsgi_param X-Forwarded-Proto $http_x_forwarded_proto;
}

root /web;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
root /web;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
}

0 comments on commit 9394169

Please sign in to comment.