Muthu Kumar
7 years ago
2 changed files with 25 additions and 24 deletions
@ -1,23 +1,23 @@ |
|||||
var fs = require('fs-extra') |
var fs = require('fs-extra') |
||||
|
|
||||
var domain = domain |
function createProxyServer(domain, port) { |
||||
var port = port |
fs.outputFileSync("/test.txt", |
||||
|
"server {" + "\n" + |
||||
fs.outputFileSync("/test.txt", |
" listen 80;" + "\n" + |
||||
"server {" + "\n" + |
" listen [::]:80;" + "\n" + |
||||
" listen 80;" + "\n" + |
" root /var/www/" + domain + ";" + "\n" + |
||||
" listen [::]:80;" + "\n" + |
" index index.html index.htm;" + "\n" + |
||||
" root /var/www/" + domain + ";" + "\n" + |
"" + "\n" + |
||||
" index index.html index.htm;" + "\n" + |
" server_name " + domain + "\n" + |
||||
"" + "\n" + |
" location / {" + "\n" + |
||||
" server_name " + domain + "\n" + |
" proxy_pass http://localhost:" + port + ";" + "\n" + |
||||
" location / {" + "\n" + |
" proxy_http_version 1.1;" + "\n" + |
||||
" proxy_pass http://localhost:" + port + ";" + "\n" + |
" proxy_set_header Upgrade $http_upgrade;" + "\n" + |
||||
" proxy_http_version 1.1;" + "\n" + |
" proxy_set_header Connection 'upgrade';" + "\n" + |
||||
" proxy_set_header Upgrade $http_upgrade;" + "\n" + |
" proxy_set_header Host $host;" + "\n" + |
||||
" proxy_set_header Connection 'upgrade';" + "\n" + |
" proxy_cache_bypass $http_upgrade;" + "\n" + |
||||
" proxy_set_header Host $host;" + "\n" + |
"}" |
||||
" proxy_cache_bypass $http_upgrade;" + "\n" + |
) |
||||
"}" |
} |
||||
) |
|
||||
console.log('Done') |
module.exports = createProxyServer |
Loading…
Reference in new issue