deploy: Apache2 리버스 프록시 설치 스크립트 추가
- Apache2 설치·모듈·HTTPS(certbot webroot)·vhost 자동 구성 - HTTP 전용 부트스트랩/테스트 설정 추가 - 기존 nginx 인증서 갱신 방식을 webroot로 자동 전환 - 짧은 주소 리다이렉트를 next.config.ts로 이동해 웹서버 공통화
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
# __DOMAIN__ — Apache 2.4 HTTP 전용 리버스 프록시
|
||||
# - 인증서 발급 전 부트스트랩(certbot webroot) 또는 HTTP_ONLY=1 테스트용으로 사용합니다.
|
||||
# - deploy/apache2/install.sh 가 __DOMAIN__, __DOMAIN_ALIAS__, __APP_PORT__ 를 치환합니다.
|
||||
# - 운영에서는 install.sh 가 HTTPS 설정(saftyovhcable.kr.conf)으로 교체합니다.
|
||||
|
||||
<VirtualHost *:80>
|
||||
ServerName __DOMAIN__
|
||||
ServerAlias __DOMAIN_ALIAS__
|
||||
|
||||
DocumentRoot /var/www/html
|
||||
<Directory /var/www/html>
|
||||
Options -Indexes +FollowSymLinks
|
||||
AllowOverride None
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
# certbot(webroot) 인증서 발급/갱신용
|
||||
Alias /.well-known/acme-challenge/ /var/www/html/.well-known/acme-challenge/
|
||||
<Directory /var/www/html/.well-known/acme-challenge>
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
ProxyRequests Off
|
||||
ProxyPreserveHost On
|
||||
ProxyTimeout 120
|
||||
|
||||
# 레거시 정적 자산은 프록시하지 않고 /var/www/html 에서 직접 서비스
|
||||
ProxyPass /addMarker.html !
|
||||
ProxyPass /blogload.js !
|
||||
ProxyPass /res/ !
|
||||
ProxyPass /.well-known/ !
|
||||
|
||||
LimitRequestBody 62914560
|
||||
|
||||
<Location "/res/">
|
||||
ExpiresActive On
|
||||
ExpiresDefault "access plus 7 days"
|
||||
Header set Cache-Control "public, max-age=604800"
|
||||
</Location>
|
||||
|
||||
# Next.js 애플리케이션 (systemd: yonggong.service)
|
||||
ProxyPass / http://127.0.0.1:__APP_PORT__/ upgrade=websocket
|
||||
ProxyPassReverse / http://127.0.0.1:__APP_PORT__/
|
||||
|
||||
RequestHeader set X-Forwarded-Proto "http"
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/__DOMAIN__.error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/__DOMAIN__.access.log combined
|
||||
</VirtualHost>
|
||||
Reference in New Issue
Block a user