Skip to content

Commit c5fcfe8

Browse files
committed
- added ip-port info
- update readme
1 parent 338ed7d commit c5fcfe8

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ $ apache-to-nginx <apache_virtual_host.conf> <nginx_conf_files_location> <templa
1717

1818
***Examples***
1919
```sh
20-
# generate configuration file with default template(php)
20+
# generate configuration file with default template (PHP-FPM)
2121
$ apache-to-nginx /etc/apache2/sites-available/example.com.conf /etc/nginx/site-available
2222

2323
# generate configuration file with custom template
@@ -29,7 +29,7 @@ $ apache-to-nginx /etc/apache2/sites-available/example.com.conf /etc/nginx/site-
2929
Default configuration template:
3030
```
3131
server {
32-
listen 80;
32+
listen {listen};
3333
server_name {serverName};
3434
root {directory};
3535

default.tpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
server {
2-
listen 80;
2+
listen {listen};
33
server_name {serverName};
44
root {directory};
55

main.js

+4
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ apacheconf(apacheConfFile, function (err, config, parser) {
3434
serverName = serverName.concat(hostConf.ServerAlias);
3535
}
3636

37+
// ip-port
38+
var listen = hostConf.$args || '80';
39+
3740
// format template
3841
var formattedTpl = format(configTpl, {
42+
listen : listen,
3943
serverName : serverName[0],
4044
directory : hostConf.DocumentRoot[0]
4145
});

0 commit comments

Comments
 (0)