Skip to content

Instantly share code, notes, and snippets.

@luxwarp
Last active August 20, 2019 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luxwarp/d17b247c9a90eaac2bb1d580df330d5a to your computer and use it in GitHub Desktop.
Save luxwarp/d17b247c9a90eaac2bb1d580df330d5a to your computer and use it in GitHub Desktop.
Example Nginx server block config for Vue app.
# Example server block config for Vue app.
# Author: Mikael Luxwarp Carlsson mikael.m.carlsson@gmail.com
# Created: 2019-08-20
# License: ISC
server {
# What ports should be listened to.
listen 80;
listen [::]:80;
# the path to site web root (eg /var/www/html).
root /path/to/vue/project;
# name of index files that can be used inside web root.
index index.html index.htm;
# The urls this config should listen to.
server_name example.com www.example.com;
# Location block for url
location / {
try_files $uri /index.html;
}
# where to store log files.
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment