File tree 2 files changed +27
-0
lines changed
2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
44
44
### devops
45
45
46
46
- [ Check The Status of All Services] ( devops/check-the-status-of-all-services.md )
47
+ - [ Check The Syntax Of nginx Files] ( devops/check-the-syntax-of-nginx-files.md )
47
48
- [ Push Non-master Branch To Heroku] ( devops/push-non-master-branch-to-heroku.md )
48
49
- [ Reload The nginx Configuration] ( devops/reload-the-nginx-configuration.md )
49
50
- [ Wipe A Heroku Postgres Database] ( devops/wipe-a-heroku-postgres-database.md )
Original file line number Diff line number Diff line change
1
+ # Check The Syntax Of nginx Files
2
+
3
+ The syntax of [ ` nginx ` ] ( https://www.nginx.com/ ) configuration files can be a
4
+ bit finicky. On top of that, some ` nginx ` server commands can fail silently.
5
+ Get more confidence by using the following command to check for syntax
6
+ errors in those files:
7
+
8
+ ``` bash
9
+ $ [sudo] nginx -t
10
+ ```
11
+
12
+ If there is an error, you might see something like this:
13
+
14
+ ``` bash
15
+ $ sudo nginx -t
16
+ nginx: [emerg] unexpected " ;" in /etc/nginx/nginx.conf:16
17
+ nginx: configuration file /etc/nginx/nginx.conf test failed
18
+ ```
19
+
20
+ If all looks good, then you'll see this:
21
+
22
+ ``` bash
23
+ $ sudo nginx -t
24
+ nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
25
+ nginx: configuration file /etc/nginx/nginx.conf test is successful
26
+ ```
You can’t perform that action at this time.
0 commit comments