1 vim /home/nginx/conf/nginx.conf
2
3
4
5 user nginx;
6 worker_processes 1;
7
8
9 error_log /var/log/nginx/error.log warn;
10 pid /var/run/nginx.pid;
11
12
13
14
15 events {
16 worker_connections 1024;
17 }
18
19
20
21
22 http {
23 include /etc/nginx/mime.types;
24 default_type application/octet-stream;
25
26
27 log_format main '$remote_addr - $remote_user [$time_local] "$request" '
28 '$status $body_bytes_sent "$http_referer" '
29 '"$http_user_agent" "$http_x_forwarded_for"';
30
31
32 access_log /var/log/nginx/access.log main;
33
34
35 sendfile on;
36 #tcp_nopush on;
37
38
39 keepalive_timeout 65;
40
41
42 #gzip on;
43
44
45 #include /etc/nginx/mine/conf.d/*.conf;
46 server {
47 listen 80;
48 server_name www.xxxxxx.tech;
49 rewrite ^(.*)$ https://$host$1 permanent;
50 }
51 server {
52 listen 443 ssl;
53 server_name localhost;
54 server_name www.xxxxxx.tech;
55 ssl_certificate ./cert/2026015_xxxxxx.tech.pem;
56 ssl_certificate_key ./cert/2026015_xxxxxx.tech.key;
57 ssl_session_timeout 5m;
58 ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
59 ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
60 ssl_prefer_server_ciphers on;
61 location / {
62 root /usr/share/nginx/html;
63 index index.html index.htm;
64 }
65 error_page 500 502 503 504 /50x.html;
66 location = /50x.html {
67 root /usr/share/nginx/html;
68 }
69 }
70 }