-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from SAINIAbhishek/frontend_ngnix
nginx configuration
- Loading branch information
Showing
5 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Define the user and group for Nginx worker processes | ||
user nginx; | ||
worker_processes auto; | ||
|
||
# Define paths for error and PID logs | ||
error_log /var/log/nginx/error.log notice; | ||
pid /var/run/nginx.pid; | ||
|
||
events { | ||
worker_connections 1024; # Max connections per worker | ||
} | ||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /var/log/nginx/access.log main; | ||
|
||
sendfile on; | ||
keepalive_timeout 65; | ||
|
||
# Configure the server block | ||
server { | ||
listen 80; # Listen on port 80 for HTTP requests | ||
server_name localhost; # Server name for handling requests (typically used for virtual hosts) | ||
|
||
root /usr/share/nginx/html; # Root directory for your static files | ||
|
||
# Default file to serve when accessing the root directory | ||
index index.html; | ||
|
||
# Handle URL routing for Single Page Applications (SPA) | ||
location / { | ||
try_files $uri $uri/ /index.html; # Try to serve the requested file, or fallback to index.html | ||
} | ||
|
||
# Cache static assets to improve performance | ||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { | ||
expires 1d; | ||
add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters