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 17, 2024
1 parent aacc07f commit ca27951
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 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 /cscdscds prod_log; # TODO(alok)!: need to see what location to use

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

Expand All @@ -23,6 +28,11 @@ 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;
etag off;

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

location /socket.io {
proxy_http_version 1.1;

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

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

location / {

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

0 comments on commit ca27951

Please sign in to comment.