I tried to copy it to the folder and found this
Last login: Wed Jul 7 00:23:07 2021 from 183.197.16.169
[root@archlinux ~]# cd /etc/nginx
[root@archlinux nginx]# ls
fastcgi.conf koi-win scgi_params uwsgi_params
fastcgi_params mime.types sites-available web_ssl
koi-utf nginx.conf sites-enabled win-utf
[root@archlinux nginx]# rm sites-enabled/www.conf
[root@archlinux nginx]# cp sites-available/www.conf sites-enabled/www.conf
[root@archlinux nginx]# systemctl restart nginx
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xeu nginx.service" for details.
[root@archlinux nginx]# nginx -t
2021/07/07 00:36:18 [warn] 1031299#1031299: the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx/sites-enabled/www.conf:10
2021/07/07 00:36:18 [emerg] 1031299#1031299: "location" directive is not allowed here in /etc/nginx/sites-enabled/www.conf:17
nginx: configuration file /etc/nginx/nginx.conf test failed
I fix it but the web told me ERR_TOO_MANY_REDIRECTS
[root@archlinux sites-enabled]# nginx -t
2021/07/07 00:47:20 [warn] 1031657#1031657: could not build optimal types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_size: 64; ignoring types_hash_bucket_size
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@archlinux sites-enabled]# cat sites-enabled/www.conf
cat: sites-enabled/www.conf: No such file or directory
[root@archlinux sites-enabled]# cat /etc/nginx/sites-enabled/www.conf
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name malacology.net;
ssl_certificate /etc/nginx/web_ssl/www/1_www.malacology.net_bundle.crt;
ssl_certificate_key /etc/nginx/web_ssl/www/2_www.malacology.net.key;
# ssl on;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
location / {
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;
proxy_pass http://120.xx.xxx.xx;
proxy_read_timeout 90;
proxy_redirect http://120.xx.xxx.xx https://malacology.net;
}
}
I fix the warning by vim /etc/nginx/nginx.conf, but it still reports ERR_TOO_MANY_REDIRECTS
http {
----
types_hash_max_size 4096;
types_hash_bucket_size 64;
----
}