Skip to content

Commit

Permalink
initial comment to add log_format
Browse files Browse the repository at this point in the history
Signed-off-by: Dipankar Das <[email protected]>
  • Loading branch information
dipankardas011 committed Jun 18, 2024
1 parent aacc07f commit ef4f52c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Docker/nginx/template.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ upstream frappe-bench-frappe {
upstream frappe-bench-socketio-server {
server socketio:80 fail_timeout=120;
}

log_format prod_log '{"Request":"$request","Status":"$status","Request_URI":"$request_uri","Host":"$host","Client_IP":"$remote_addr","Proxy_IP(s)":"$proxy_add_x_forwarded_for","Proxy_Hostname":"$proxy_host","Real_IP":"$http_x_real_ip","User_Client":"$http_user_agent","TimeTaken":"$request_time","ContentType":"$content_type"}';

server {

listen 80;
listen [::]:80;

access_log /var/log/nginx/access.log prod_log;

server_name {{ ' '.join(SITENAME.split(',')) }};
root /workspace/frappe-bench/sites;

Expand All @@ -23,6 +28,10 @@ server {
add_header X-XSS-Protection "1; mode=block";
add_header Referrer-Policy "same-origin, strict-origin-when-cross-origin";

proxy_hide_header X-Powered-By;
proxy_hide_header X-Forwarded-Host;

server_tokens off;

location /assets {
try_files $uri =404;
Expand All @@ -35,6 +44,7 @@ server {

location /socket.io {
proxy_http_version 1.1;

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Frappe-Site-Name $host;
Expand All @@ -48,7 +58,6 @@ server {
}

location / {

rewrite ^(.+)/$ $1 permanent;
rewrite ^(.+)/index\.html$ $1 permanent;
rewrite ^(.+)\.html$ $1 permanent;
Expand Down

0 comments on commit ef4f52c

Please sign in to comment.