Pass cert password to Nginx with https site during restart

Nginx has ssl_password_file parameter. Specifies a file with passphrases for secret keys where each passphrase is specified on a separate line. Passphrases are tried in turn when loading the key. Example: http { ssl_password_file /etc/keys/global.pass; … server { server_name www1.example.com; ssl_certificate_key /etc/keys/first.key; } server { server_name www2.example.com; # named pipe can also be used instead … Read more

Fetching static files failed with 404 in nginx

You should use alias instead of root. root appends the trailing URL parts to your local path (e.g. http://test.ndd/trailing/part, it will add /trailing/part to your local path). Instead of that, alias does exactly what you want: when http://test.ndd/static/ is requested, /static is mapped to your alias exactly, without appending static again. For example: location /static … Read more

uwsgi IOError: write error

The problem is that clients abort the connection and then Nginx closes the connection without telling uwsgi to abort. Then when uwsgi comes back with the result the socket is already closed. Nginx writes a 499 error in the log and uwsgi throws a IOError. The non optimal solution is to tell Nginx not to … Read more

How to deploy NextJS with NGINX?

Check this: https://gist.github.com/iam-hussain/2ecdb934a7362e979e3aa5a92b181153 Reference for HTTP/HTTPS: https://gist.github.com/iam-hussain/2ecdb934a7362e979e3aa5a92b181153 Start PM2 nextJS service on port 8080: cd PROJECT_DIRECTORY pm2 start “npm run start — -p 8080” –name contractverifier Configure Nginx: Replace this file with the below code /etc/nginx/sites-available/default server { server_name www.DOMAINNAME.com DOMAINNAME.com; index index.html index.htm; root /home/ubuntu/PROJECT_FOLDER; #Make sure your using the full path # Serve … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)