rhymix.cnf 파일 저장 후 디포트 파일을 아래처럼 수정해줬습니다.
include snippets/rhymix.conf; 추가 및
location / {
try_files $uri $uri/ =404;
if (!-e $request_filename) {
rewrite ^.*$ /index.php last;
}
}
location / {
}
를 제거해 줬습니다.
이후 디폴트 파일 내용입니다.
# Default HTTPS server configuration
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name smrte.or.kr;
client_max_body_size 32m;
ssl_certificate /etc/letsencrypt/live/smrte.or.kr/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/smrte.or.kr/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/smrte.or.kr/fullchain.pem;
include /etc/nginx/snippets/ssl.conf;
include snippets/rhymix.conf;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_read_timeout 300;
}
location ~ /\.ht {
deny all;
}
# HTTPS www. server configuration
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.smrte.or.kr;
ssl_certificate /etc/letsencrypt/live/smrte.or.kr/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/smrte.or.kr/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/smrte.or.kr/fullchain.pem;
include /etc/nginx/snippets/ssl.conf;
return 301 https://smrte.or.kr$request_uri;
}
# Default server configuration
server {
listen 80;
listen [::]:80 default_server;
server_name smrte.or.kr;
include /etc/nginx/snippets/letsencrypt.conf;
return 301 https://smrte.or.kr$request_uri;
}
# HTTP - CNAME Connect www.smrte.or.kr to smrte.or.kr
server {
listen 80;
listen [::]:80;
server_name www.smrte.or.kr;
include /etc/nginx/snippets/letsencrypt.conf;
return 301 https://www.smrte.or.kr$request_uri;
}
}
체크해 보니 아래와 같은 메세지가 뜨네요
$ sudo nginx -t
2024/07/21 15:49:52 [emerg] 17105#17105: open() "/snippets/rhymix.conf" failed (2: No such file or directory) in /etc/nginx/sites-enabled/default:14
nginx: configuration file /etc/nginx/nginx.conf test failed
rhymix.conf 파일 내용은 아래와 같습니다.
# block direct access to templates, XML schemas, config files, dotfiles, environment info, etc.
location ~ ^/modules/editor/(skins|styles)/.+\.html$ {
# pass
}
location ~ ^/(addons|common/tpl|files/(faceOff|ruleset)|(m\.)?layouts|modules|plugins|themes|widgets|widgetstyles)/.+\.(html|xml|blade\.php)$ {
return 403;
}
location ~ ^/files/(attach|config|cache)/.+\.(ph(p|t|ar)?[0-9]?|p?html?|cgi|pl|exe|[aj]spx?|inc|bak)$ {
return 403;
}
location ~ ^/files/(env|member_extra_info/(new_message_flags|point))/ {
return 403;
}
location ~ ^/(\.git|\.ht|\.travis|codeception\.|composer\.|Gruntfile\.js|package\.json|CONTRIBUTING|COPYRIGHT|LICENSE|README) {
return 403;
}
# fix incorrect relative URLs (for legacy support)
location ~ ^/(.+)/(addons|files|layouts|m\.layouts|modules|widgets|widgetstyles)/(.+) {
try_files $uri $uri/ /$2/$3;
}
# fix incorrect minified URLs (for legacy support)
location ~ ^/(.+)\.min\.(css|js)$ {
try_files $uri $uri/ /$1.$2;
}
# fix download URL when other directives for static files are present
location ~ ^/files/download/ {
try_files $uri $uri/ /index.php$is_args$args;
}
# all other short URLs
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
에러메시지를 보면 include snippets/rhymix.conf; 가 문제인것 같은데 어떻게 수정해야할지 잘 모르겠습니다.
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ====
Authentication is required to restart 'nginx.service'.
Authenticating as: Ubuntu (ubuntu)
Password:
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ====
Failed to restart nginx.service: Access denied
See system logs and 'systemctl status nginx.service' for details.
현상태에서 서버 재시작을 시도해 봤는데 에러가 발생 합니다. 이것도 추가로 올려 봅니다.