Once you're finished with development and ready to share your Portal with the world, you will want to secure your portal by turning off the edit and upload features, and enabling cache.

NOTE: I’m using “ubuntu” as the username and home directory. If your machine has a different username, you may need to change things below:

Disable editing

  1. Open the app’s nginx conf (example: /home/ubuntu/app/nginx/conf.d/default.conf)
  2. Find the two blocks starting with  location /edit/ {
    and location /upload/ {
  3. Using your unix CLI text editor of choice (nano, vim, etc), comment out both blocks entirely (by adding # to the beginning of the line).

Enable caching of assets, css, and js

  1. Open the Portal app’s Nginx conf (e.g. /home/ubuntu/app/nginx/conf.d/default.conf)
  2. Find the block starting with location ~ ^/(js|css|img|assets)/(.+) {
  3. At the bottom of this block comment out include nocache_params;

Backup and remove static front end pages

sudo mv /home/ubuntu/app/static/edit.html ~/edit.html.bak 
sudo mv /home/ubuntu/app/static/upload.html ~/upload.html.bak

Restart Nginx

docker-compose exec zwaf nginx -s reload