Configuring Functions
Configuring HTTPS
- Open the nginx.conf file:
1vim /usr/local/tengine-nginx/conf/nginx.conf - Press i to enter the insert mode and modify the file as follows:
- Change #user nobody; to user root;.
- Delete all comment tags (#) from the HTTPS module.
- Change listen 443 ssl; in the HTTPS module to listen 20000 ssl;. You can also use the default port.
- In the HTTPS module, change ssl_certificate cert.pem; to ssl_certificate /usr/local/tengine-nginx/server_2048.crt;.
- In the HTTPS module, change ssl_certificate_key cert.key; to ssl_certificate_key /usr/local/tengine-nginx/server_2048.key;.
- In the HTTPS module, add ssl_async on; below server_name localhost; to enable the asynchronous function.
File before modification:
#user nobody; ... # HTTPS server # #server { # listen 443 ssl; # server_name localhost; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #}File after modification:user root; ... # HTTPS server # server { listen 20000 ssl; server_name localhost; ssl_async on; ssl_certificate /usr/local/tengine-nginx/server_2048.crt; ssl_certificate_key /usr/local/tengine-nginx/server_2048.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { root html; index index.html index.htm; } } - Press Esc, type :wq!, and press Enter to save the file and exit.
Configuring HTTP
- Open the nginx.conf file:
1vim /usr/local/tengine-nginx/conf/nginx.conf - Press i to enter the insert mode and modify the file as follows:
- Change #user nobody; to user root;.
- In the HTTP module, change listen 80; to listen 10000;. You can also use the default port.
File before modification:
#user nobody; ... http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } } }File after modification:
user root; ... http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 10000; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } } } ... - Press Esc, type :wq!, and press Enter to save the file and exit.
Parent topic: Running and Verifying Tengine