These instructions will enable you to secure HTTP traffic of your self-hosted infrastructure, using a reverse proxy with Nginx
.
standardnotes.conf
within /etc/nginx/sites-available
:server {
listen 80;
listen [::]:80;
server_name yourdomain.com;
access_log /var/log/nginx/standardnotes-access.log;
error_log /var/log/nginx/standardnotes-error.log;
client_max_body_size 50M;
location / {
proxy_pass http://127.0.0.1:3000;
}
}
Note Replace
yourdomain.com
with your actual domain and3000
with the port you have specified in your docker compose file if you have changed it.
files-standardnotes.conf
within /etc/nginx/sites-available
:server {
listen 80;
listen [::]:80;
server_name your-files-domain.com;
access_log /var/log/nginx/standardnotes-files-access.log;
error_log /var/log/nginx/standardnotes-files-error.log;
client_max_body_size 50M;
location / {
proxy_pass http://127.0.0.1:3125;
}
}
Note Replace
your-files-domain.com
with your actual domain and3125
with the port you have specified in your docker compose file if you have changed it.
ln -s /etc/nginx/sites-available/standardnotes.conf /etc/nginx/sites-enabled/standardnotes.conf
ln -s /etc/nginx/sites-available/files-standardnotes.conf /etc/nginx/sites-enabled/files-standardnotes.conf
There may be different ways to restart Nginx. If you installed Nginx from Ubuntu's default repository just type:
$ sudo service nginx restart
Nginx
configuration with:$ nginx -t
You can also check if your sites have been properly added to Nginx configuration:
$ nginx -T
Go to certbot to get and install your HTTPS certificates for both the sites.
Certbot should automatically update your Nginx configuration and create SSL certificates for you.
After completing the above instructions, your Sync server should be HTTPS enabled!
In the account menu, choose Advanced Options
and enter the address of your new server in Sync Server Domain
.
Then, register for a new account or log into an existing account and begin using your private new secure Standard Notes server!