You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ Then, start a CGI server:
48
48
npx cgi-server --filePath ./cgi-bin
49
49
```
50
50
51
-
# Basic Usage
51
+
##Basic Usage
52
52
53
53
Here’s an example of how to set up a CGI server with `cgi-core`:
54
54
@@ -83,15 +83,15 @@ app.listen(3000);
83
83
84
84
Usage example using [Express](https://github.com/lfortin/node-cgi-core/blob/master/docs/express.md).
85
85
86
-
# Configuration options
86
+
##Configuration options
87
87
88
88
### urlPath
89
89
90
-
Base url for routing. Default: '/cgi-bin'
90
+
Base url for routing. Default: `'/cgi-bin'`
91
91
92
92
### filePath
93
93
94
-
File path where the CGI scripts are located. It is strongly advised to set a value for `filePath` (example: './cgi-bin'). Default: `process.cwd()`
94
+
File path where the CGI scripts are located. It is strongly advised to set a value for `filePath` (example: `'./cgi-bin'`). Default: `process.cwd()`
95
95
96
96
### extensions
97
97
@@ -117,7 +117,7 @@ Default:
117
117
118
118
### indexExtension
119
119
120
-
File extension to lookup for an index CGI script in any given directory. Default: 'js'
120
+
File extension to lookup for an index CGI script in any given directory. Default: `'js'`
121
121
122
122
### debugOutput
123
123
@@ -202,7 +202,7 @@ Default: `false`
202
202
203
203
> ⚠️ **Important:** Only enable this if you are **running behind a trusted reverse proxy** (like Nginx or a load balancer). Enabling `trustProxy` when exposed to the public internet can allow **header spoofing** by clients.
204
204
205
-
# Start a CGI Server from the Command Line
205
+
##Start a CGI Server from the Command Line
206
206
207
207
The command `cgi-server` can be used to run an HTTP server to serve CGI scripts.
In addition to the standard HTTP-related variables, the following CGI environment variables are supported:
237
237
@@ -255,7 +255,7 @@ SERVER_PROTOCOL
255
255
SERVER_SOFTWARE
256
256
```
257
257
258
-
# 🔁 Using a Reverse Proxy (e.g., Nginx)
258
+
##🔁 Using a Reverse Proxy (e.g., Nginx)
259
259
260
260
While `cgi-core` is capable of serving CGI scripts directly over HTTP/1.1, it's often recommended to use a **reverse proxy** like **Nginx** in front of your Node.js server for:
261
261
@@ -268,7 +268,7 @@ While `cgi-core` is capable of serving CGI scripts directly over HTTP/1.1, it's
268
268
269
269
Below is an example Nginx configuration that:
270
270
271
-
- Proxies `/cgi-bin` requests to the Node.js/`cgi-core` server running on `localhost:3001`
271
+
- Proxies `/cgi-bin` requests to the Node.js/cgi-core server running on `localhost:3001`
272
272
- Enables **caching** for `GET` responses
273
273
- Serves static assets directly from the filesystem with browser caching
274
274
@@ -321,7 +321,7 @@ http {
321
321
}
322
322
```
323
323
324
-
# License
324
+
##License
325
325
326
326
`cgi-core` is released under the [MIT License](https://github.com/lfortin/node-cgi-core/blob/master/LICENSE).
0 commit comments