Update nginx.conf
Browse files- 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;
|
| 6 |
|
| 7 |
events {
|
| 8 |
worker_connections 1024;
|
|
@@ -19,31 +19,29 @@ http {
|
|
| 19 |
access_log /dev/stdout main;
|
| 20 |
|
| 21 |
sendfile on;
|
| 22 |
-
|
| 23 |
|
| 24 |
keepalive_timeout 65;
|
| 25 |
|
| 26 |
-
|
| 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
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 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 |
+
}
|