Content

Bitnami Nginx for AWS Cloud

Nginx is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server.

How to configure Nginx?

The default configuration file for Nginx is located at /opt/bitnami/nginx/conf/nginx.conf. Change the port using the listen directive:

listen 1234;

Nginx was compiled to include most popular extensions: compression options, Passenger module for Ruby applications and PageSpeed module.

How to create an SSL certificate?

You can create your own SSL certificate with the OpenSSL binary. A certificate request can then be sent to a certificate authority (CA) to get it signed into a certificate, or if you have your own certificate authority, you may sign it yourself, or you can use a self-signed certificate (because you just want a test certificate or because you are setting up your own CA).

NOTE: In the following steps, replace the APPNAME placeholder with the name of your application directory.

How to debug Nginx errors?

The Nginx log file is located at /opt/bitnami/nginx/log/error.log.

If you configured Nginx to use a privileged port (port number < 1024), check that the Nginx server is running as user daemon in the configuration file. This user should also have write privileges to the /opt/bitnami/nginx/log/ directory.

How to enable HTTPS support with SSL certificates?

NOTE: The steps below assume that you are using a custom domain name and that you have already configured the custom domain name to point to your cloud server. In the following steps, replace the APPNAME placeholder with the name of your application directory.

Bitnami images come with SSL support already pre-configured and with a dummy certificate in place. Although this dummy certificate is fine for testing and development purposes, you will usually want to use a valid SSL certificate for production use. You can either generate this on your own (explained here) or you can purchase one from a commercial certificate authority.

Once you obtain the certificate and certificate key files, you will need to update your server to use them. Follow these steps to activate SSL support:

Use the table below to identify the correct locations for your certificate and configuration files.

How to configure Nginx with Phusion Passenger to run Ruby on Rails applications?

How to modify the allowed limit for uploaded files in the Nginx configuration?

The maximum size for uploaded files is set to 1MB by default in the Nginx configuration. You can add the following option at the end of this file /opt/bitnami/apps/APP_NAME/conf/nginx-app.conf to increase the allowed size for uploads. Replace the APP_NAME placeholder with the correct directory name.

client_max_body_size SIZE;

NOTE: Remember to replace the SIZE placeholder with the value you want to set. For example: client_max_body_size 8m;.