Skip to content

Commit

Permalink
Merge pull request #127 from FACETICKER/issue/105
Browse files Browse the repository at this point in the history
Nginx ๋ฆฌ๋ฒ„์Šค ํ”„๋ก์‹œ ์„ค์ • ์ˆ˜์ •
  • Loading branch information
yxhwxn authored Aug 9, 2023
2 parents 2b55284 + 8c95967 commit db0b0b4
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 53 deletions.
108 changes: 63 additions & 45 deletions .platform/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,52 +11,70 @@ events {
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

include conf.d/*.conf;

map $http_upgrade $connection_upgrade {
default "upgrade";
}

upstream node {
server 127.0.0.1:8080;
keepalive 1024;
}

server {
listen 80 default_server;
listen [::]:80 default_server;

location / {
proxy_pass http://node;
proxy_http_version 1.1;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Upgrade $http_upgrade;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

access_log /var/log/nginx/access.log main;

client_header_timeout 300;
client_body_timeout 300;
send_timeout 300;
proxy_connect_timeout 300;
proxy_read_timeout 300;
proxy_send_timeout 300;
keepalive_timeout 300;
gzip off;
gzip_comp_level 4;

# Include the Elastic Beanstalk generated locations
include conf.d/elasticbeanstalk/healthd.conf;
}
}
include conf.d/*.conf;

map $http_upgrade $connection_upgrade {
default "upgrade";
}

upstream node {
server 127.0.0.1:8080;
keepalive 1024;
}

# Server block for the frontend domain
server {
listen 80;
listen [::]:80;
server_name www.faceticker.site;

location / {
# Configure how you want to handle frontend requests
}

access_log /var/log/nginx/frontend_access.log main;

# Other frontend-related configuration
# ...
}

# Server block for the backend domain
server {
listen 80;
listen [::]:80;
server_name app.faceticker.site;

location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Upgrade $http_upgrade;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

access_log /var/log/nginx/backend_access.log main;

client_header_timeout 300;
client_body_timeout 300;
send_timeout 300;
proxy_connect_timeout 300;
proxy_read_timeout 300;
proxy_send_timeout 300;
keepalive_timeout 300;
gzip off;
gzip_comp_level 4;

# Include the Elastic Beanstalk generated locations
include conf.d/elasticbeanstalk/healthd.conf;
}
}
18 changes: 10 additions & 8 deletions config/express.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import express from "express";
import express from "express";
import compression from "compression";
import methodOverride from "method-override";
import cors from "cors";
import userRouter from "../src/app/user/userRoute.js";
import {specs, swaggerUi} from "./swagger.js";
import { specs, swaggerUi } from "./swagger.js";
const app = express();


app.use(compression());
app.use(express.json());
app.use(express.urlencoded({extended:true}));
app.use(express.urlencoded({ extended: true }));
app.use(methodOverride());
app.use(cors());
app.use('/app/api-docs', swaggerUi.serve, swaggerUi.setup(specs, { explorer: true }));
app.use('/app',userRouter);

app.use(
"/api-docs",
swaggerUi.serve,
swaggerUi.setup(specs, { explorer: true })
);
app.use("/", userRouter);

export default app;
export default app;

0 comments on commit db0b0b4

Please sign in to comment.