Znfeoqm commited on
Commit
7423108
·
verified ·
1 Parent(s): a7de9f4

Update nginx.conf

Browse files
Files changed (1) hide show
  1. nginx.conf +12 -14
nginx.conf CHANGED
@@ -2,7 +2,7 @@ user nginx;
2
  worker_processes auto;
3
 
4
  error_log /dev/stderr warn;
5
- pid /tmp/nginx.pid; # PID file moved to /tmp for permissions
6
 
7
  events {
8
  worker_connections 1024;
@@ -19,31 +19,29 @@ http {
19
  access_log /dev/stdout main;
20
 
21
  sendfile on;
22
- #tcp_nopush on;
23
 
24
  keepalive_timeout 65;
25
 
26
- #gzip on;
27
 
28
- # Use /tmp for client body temp path and proxy temp path
29
  client_body_temp_path /tmp/client_temp;
30
  proxy_temp_path /tmp/proxy_temp;
31
  fastcgi_temp_path /tmp/fastcgi_temp;
32
  uwsgi_temp_path /tmp/uwsgi_temp;
33
  scgi_temp_path /tmp/scgi_temp;
34
 
35
- # This is the crucial server block for your React application
36
  server {
37
- listen 8080; # Nginx will listen on port 8080, which is typically allowed for non-root users
38
- root /usr/share/nginx/html; # This is where your built React app files are located
39
- index index.html index.htm; # Default files to serve if a directory is requested
40
-
41
- # This location block is essential for Single-Page Applications (SPAs) like React.
42
- # It tries to serve the requested file ($uri), then a directory ($uri/),
43
- # and if neither is found, it falls back to serving index.html.
44
- # This allows React's client-side routing to work correctly.
45
  location / {
46
  try_files $uri $uri/ /index.html;
47
  }
 
 
48
  }
49
- }
 
2
  worker_processes auto;
3
 
4
  error_log /dev/stderr warn;
5
+ pid /tmp/nginx.pid;
6
 
7
  events {
8
  worker_connections 1024;
 
19
  access_log /dev/stdout main;
20
 
21
  sendfile on;
22
+ tcp_nopush on;
23
 
24
  keepalive_timeout 65;
25
 
26
+ gzip on;
27
 
 
28
  client_body_temp_path /tmp/client_temp;
29
  proxy_temp_path /tmp/proxy_temp;
30
  fastcgi_temp_path /tmp/fastcgi_temp;
31
  uwsgi_temp_path /tmp/uwsgi_temp;
32
  scgi_temp_path /tmp/scgi_temp;
33
 
 
34
  server {
35
+ listen 7860; # CHANGED: Nginx will now listen on port 7860
36
+ server_name localhost;
37
+
38
+ root /usr/share/nginx/html;
39
+ index index.html;
40
+
 
 
41
  location / {
42
  try_files $uri $uri/ /index.html;
43
  }
44
+
45
+ error_page 404 /index.html;
46
  }
47
+ }