Skip to content

Commit fbd7ff8

Browse files
committed
NGINX r2
1 parent 0f58286 commit fbd7ff8

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

devops/packer.pkr.hcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ build {
4141
"sudo rm -rf /usr/share/nginx/html/*",
4242
"sudo cp -r /opt/app/dist/foundry-angular-example/* /usr/share/nginx/html/",
4343
"sudo cp /opt/app/nginx/nginx.conf /etc/nginx/nginx.conf",
44-
"sudo cp /opt/app/nginx/sites-available/* /etc/nginx/conf.d/",
45-
"sudo cp ./nginx/sites-available/local /etc/nginx/servers/angular.conf"
44+
"sudo mkdir /etc/nginx/servers",
45+
"sudo cp /opt/app/nginx/sites-available/aws /etc/nginx/servers/angular.conf",
4646
"sudo systemctl enable nginx",
4747
"sudo systemctl start nginx"
4848
]

nginx/nginx.conf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,15 @@ events {
1515

1616
# HTTP block configures web server settings.
1717
http {
18+
types_hash_max_size 2048;
19+
types_hash_bucket_size 128;
20+
1821
include /etc/nginx/mime.types; # File extensions to MIME types mapping.
1922
default_type application/octet-stream; # Default MIME type.
2023

24+
# Custom servers
25+
include /etc/nginx/servers/*;
26+
2127
# Logging settings.
2228
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
2329
'$status $body_bytes_sent "$http_referer" '
@@ -39,7 +45,4 @@ http {
3945
gzip on;
4046
gzip_disable "msie6";
4147

42-
# Include server definitions.
43-
include /etc/nginx/conf.d/*.conf;
44-
include /etc/nginx/sites-enabled/*;
4548
}

nginx/sites-available/aws

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
server {
2-
listen 80; # Listen on port 80 for HTTP connections.
3-
server_name example.com; # The domain name.
2+
listen 80;
3+
server_name localhost;
44

55
# Root directory and index files.
6-
root /usr/share/nginx/html;
7-
index index.html index.htm;
6+
root /opt/app/dist/foundry-angular-example/browser;
7+
index index.html;
88

99
# Location blocks handle requests for different resources.
1010
location / {
11-
try_files $uri $uri/ =404; # Serve static files or return a 404 error.
11+
try_files $uri $uri/ /index.html;
1212
}
1313

1414
location /api/ {
15-
proxy_pass http://backend-server-ip:port;
15+
proxy_pass http://10.192.20.146:5001;
1616
proxy_http_version 1.1;
1717
proxy_set_header Upgrade $http_upgrade;
1818
proxy_set_header Connection 'upgrade';

0 commit comments

Comments
 (0)