xxxxxxxxxx
# vi /etc/nginx/sites-enabled/default [On Debian/Ubuntu]
# vi /etc/nginx/nginx.conf [On CentOS/RHEL]
xxxxxxxxxx
$ nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
$ nginx -V
nginx version: nginx/1.11.1
built by gcc 4.9.2 (Debian 4.9.2-10)
built with OpenSSL 1.0.1k 8 Jan 2015
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf
xxxxxxxxxx
user nginx;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
server {
listen 80;
root /frontend/build;
index index.html;
location / {
try_files $uri /index.html;
}
}
}
Test Nginx configuration
xxxxxxxxxx
nginx -t
service nginx configtest
systemctl config nginx
Example response:
nginx: the configuration file /etc/nginx-sp/nginx.conf syntax is ok
nginx: configuration file /etc/nginx-sp/nginx.conf test is successful