Thanks, I try to modify my vhost configs name and here's my output now
lrwxrwxrwx 1 root root 36 十 12 21:25 /etc/nginx/sites-enabled/tyrc.conf -> /etc/nginx/sites-available/tyrc.conf
and then I try to modified my config content that I was suggested
server {
root /var/www/109work/public;
server_name saturn.tyrc.edu.tw;
index index.php;
location / {
# try_files $uri $uri/ /index.php?$query_string;
try_files $uri /index.php?$query_string;
}
location ~ .php$ {
include snippets/fastcgi-php.conf;
# PHP-FPM 的連接方式
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_read_timeout 600;
fastcgi_send_timeout 600;
fastcgi_connect_timeout 600;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/saturn.tyrc.edu.tw/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/saturn.tyrc.edu.tw/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = saturn.tyrc.edu.tw) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name saturn.tyrc.edu.tw;
return 404; # managed by Certbot
}
and new error occur after typing restart nginx
$ sudo systemctl restart nginx
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
the error detail shows
$ journalctl -xe
Hint: You are currently not seeing messages from other users and the system.
Users in groups 'adm', 'systemd-journal' can see all messages.
Pass -q to turn off this notice.
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit UNIT has successfully entered the 'dead' state.
十 12 17:50:44 saturn tracker-store[274852]: OK
十 12 17:50:44 saturn systemd[274697]: tracker-store.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit UNIT has successfully entered the 'dead' state.
十 12 20:53:02 saturn sudo[276354]: pam_unix(sudo:auth): Couldn't open /etc/securetty: No such file or directory
十 12 20:53:05 saturn sudo[276354]: pam_unix(sudo:auth): Couldn't open /etc/securetty: No such file or directory
Can I make sure the config file include vhost config now? Is there any problem in my config file?