Nginx no-www to www and www to no-www

HTTP Solution From the documentation, “the right way is to define a separate server for example.org”: server { listen 80; server_name example.com; return 301 http://www.example.com$request_uri; } server { listen 80; server_name www.example.com; … } HTTPS Solution For those who want a solution including https://… server { listen 80; server_name www.domain.com; # $scheme will get the … Read more

Node.js + Nginx – What now?

Nginx works as a front end server, which in this case proxies the requests to a node.js server. Therefore you need to setup an nginx config file for node. This is what I have done in my Ubuntu box: Create the file yourdomain.com at /etc/nginx/sites-available/: vim /etc/nginx/sites-available/yourdomain.com In it you should have something like: # … Read more

Are a WSGI server and HTTP server required to serve a Flask app?

When you “run Flask” you are actually running Werkzeug’s development WSGI server, and passing your Flask app as the WSGI callable. The development server is not intended for use in production. It is not designed to be particularly efficient, stable, or secure. It does not support all the possible features of a HTTP server. Replace … Read more

tech