리자

우분투 리눅스의 nginx에서 fastapi와 도메인을 연결하는 방법에 대해 설명합니다. #1

· 2024-02-04 (일) 15:44:15 · 1563

Describes how to connect fastapi and domains to nginx on Ubuntu Linux

 

https://www.youtube.com/watch?v=elPmCNeOlsc&t=4s

 

 

영상 순서

 

1. fastapi 로 만든 그누보드6 실행
    uvicorn main:app --reload --host 0.0.0.0 --port 8000

 

2. nginx 설치
    sudo apt update
    sudo apt install nginx

 

3. nginx 설정
    server {
        listen 80;
        server_name  your-domain.com;

        location / {
                proxy_pass http://127.0.0.1:8000;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
        }
    }

 

 4. nginx 재실행
    systemctl restart nginx

 

5. dns A 레코드 추가
    A    @    IP주소

 

=끝=


그누보드6 github 저장소
https://github.com/gnuboard/g6

 

그누보드6 사용자데모
https://g6.demo.sir.kr/

 

그누보드6 커뮤니티
https://sir.kr/main/g6/

댓글을 작성하시려면 로그인이 필요합니다.

그누보드6, 파이썬에 대한 팁과 자료를 올려주세요. 그누보드6 실서비스를 위한 웹서버 설정

+
제목 글쓴이 날짜 조회
01-05 조회 631
25-04-12 조회 1,376
24-08-29 조회 1,026
24-07-10 조회 1,121
24-07-08 조회 1,033
24-07-08 조회 865
24-07-08 조회 870
24-06-21 조회 1,150
24-06-21 조회 849
24-06-20 조회 1,130
24-05-23 조회 2,339
24-03-10 조회 3,246
24-02-15 조회 1,968
24-02-08 조회 3,079
24-02-06 조회 2,184
24-02-05 조회 2,809
24-02-04 조회 1,071
24-02-04 조회 1,675
24-02-04 조회 1,564
24-02-02 조회 1,806
24-02-01 조회 1,382
24-01-31 조회 1,267
24-01-30 조회 1,514
24-01-30 조회 1,157
24-01-30 조회 1,633
24-01-29 조회 1,156
24-01-26 조회 974
24-01-26 조회 1,515
24-01-25 조회 1,563
24-01-25 조회 1,088