ShutterStack commited on
Commit
cb0e0e4
·
verified ·
1 Parent(s): 481214d

Update nginx.conf

Browse files
Files changed (1) hide show
  1. nginx.conf +11 -9
nginx.conf CHANGED
@@ -9,16 +9,21 @@ http {
9
  sendfile on;
10
  keepalive_timeout 65;
11
 
12
- # Set a writable path for Nginx temporary files to avoid permission errors
13
- # This path must correspond to a directory created and permissioned in your Dockerfile (e.g., /tmp/nginx_cache/client_body)
 
 
 
 
14
  client_body_temp_path /tmp/nginx_cache/client_body;
 
15
 
16
  # Gzip settings for improved performance (optional but recommended)
17
  gzip on;
18
  gzip_vary on;
19
  gzip_proxied any;
20
  gzip_comp_level 6;
21
- gzip_types text/plain text/css application/json application/javascript text/xml application/xml+rss text/javascript;
22
 
23
  server {
24
  listen 7860; # Hugging Face Spaces default port for Docker SDK
@@ -39,12 +44,9 @@ http {
39
  client_max_body_size 50M; # Adjust as needed for larger file uploads via Streamlit's internal mechanism
40
  }
41
 
42
- # If you were to expose Flask directly under a subpath (e.g., /api/),
43
- # this is where you would configure it.
44
- # However, for internal communication from Streamlit to Flask,
45
- # Streamlit should directly call http://localhost:5000/preprocess/upload etc.
46
- # This block is often not needed if Streamlit is the sole public-facing app.
47
- # Example if you needed it:
48
  # location /api/ {
49
  # proxy_pass http://localhost:5000/;
50
  # proxy_set_header Host $host;
 
9
  sendfile on;
10
  keepalive_timeout 65;
11
 
12
+ # Redirect Nginx logs to Docker's standard output/error streams
13
+ error_log /dev/stderr info;
14
+ access_log /dev/stdout combined;
15
+
16
+ # Set writable paths for Nginx temporary files to avoid permission errors
17
+ # These paths correspond to directories created and permissioned in your Dockerfile
18
  client_body_temp_path /tmp/nginx_cache/client_body;
19
+ proxy_temp_path /tmp/nginx_cache/proxy;
20
 
21
  # Gzip settings for improved performance (optional but recommended)
22
  gzip on;
23
  gzip_vary on;
24
  gzip_proxied any;
25
  gzip_comp_level 6;
26
+ gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
27
 
28
  server {
29
  listen 7860; # Hugging Face Spaces default port for Docker SDK
 
44
  client_max_body_size 50M; # Adjust as needed for larger file uploads via Streamlit's internal mechanism
45
  }
46
 
47
+ # This section is commented out as it's typically not needed for a Streamlit+Flask setup where
48
+ # Streamlit calls Flask directly via localhost:5000.
49
+ # If you needed to expose Flask publicly on a subpath, you'd uncomment and configure this.
 
 
 
50
  # location /api/ {
51
  # proxy_pass http://localhost:5000/;
52
  # proxy_set_header Host $host;