Using the Websoft9 LNMP, you should have some skills for configure Nginx like below:



For the above content, we have prepared the Nginx Quik Start for users.


------


Top3 Nginx configuration you must use when using this Image


#1 Nginx HTTP VirtualHost template


server
{
listen 80;
server_name www.example.com  example.com;
index index.html index.htm index.php;
root  /data/wwwroot/www.example.com;
error_log /var/log/nginx/example.com-error.log crit;
access_log  /var/log/nginx/example.com-access.log;

include conf.d/extra/*.conf;

# include conf.d/rewrite/wordpress.conf
}


#2 Nginx Alias template


location /mysite2
{
    alias /data/wwwroot/mysite2;
    index index.php index.html;
    location ~ ^/9panel/.+\.php$ {
      alias /data/wwwroot/mysite2;
      fastcgi_pass  unix:/dev/shm/php-fpm-default.sock;
      fastcgi_index  index.php;
      fastcgi_param  SCRIPT_FILENAME /data/wwwroot/$fastcgi_script_name;
      include        fastcgi_params;
    }
 include conf.d/extra/*.conf;
}


#2 Nginx HTTPS VirtualHost template


listen 443 ssl; 
ssl_certificate /data/cert/xxx.crt;
ssl_certificate_key /data/cert/xxx.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
if ($scheme != "https") 
{
return 301 https://$host$request_uri;
}