-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
44 lines (35 loc) · 1.55 KB
/
nginx.conf
File metadata and controls
44 lines (35 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://localhost:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /strprofiler/ {
proxy_pass http://localhost:8000/; # Make sure the trailing slash is here
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Sub_filter to fix paths for href and src attributes
sub_filter_once off;
sub_filter_types text/html;
sub_filter 'href="/' 'href="/strprofiler/';
sub_filter 'src="/' 'src="/strprofiler/';
# Ensure all assets are loaded with /strprofiler/ prefix
proxy_redirect off; # Disable automatic redirects that may remove /strprofiler/
}
location /debug-var {
return 200 "$request";
}
location /str-profiler {
return 200 "Request URI: $request_uri\nRemote Port: $remote_port\nHost: $host, $hostname, host header: $http_host, host refer: $http_referer\nServer Port: $server_port\nRequest: $request\nRemote address: $remote_addr\nProxy add: $proxy_add_x_forwarded_for\nScheme: $scheme";
}
}
}