51 lines
1.3 KiB
JavaScript
51 lines
1.3 KiB
JavaScript
/*
|
|
|
|
This server useses two certificates: one for Parchment, which requires
|
|
wildcard domains, and one for all the other websites.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* 1. Shut down Admin and run 'npm run start' (in this ssl folder) */
|
|
/* 2.1 Run this command to support Parchment wildcard certs (AWS Authentication)
|
|
|
|
sudo certbot certonly \
|
|
--dns-route53 \
|
|
-d '*.parchment.page'
|
|
*/
|
|
|
|
/* 2.2 Run this command to support all others
|
|
|
|
sudo certbot certonly \
|
|
--standalone \
|
|
-d hyperia.so \
|
|
-d aryan.so \
|
|
-d admin.sun.museum \
|
|
-d america.sun.museum \
|
|
-d noahkurtis.com \
|
|
-d americanforum.net \
|
|
-d thefiveprinciples.org \
|
|
-d government.forum
|
|
*/
|
|
|
|
|
|
import http from 'http';
|
|
import httpProxy from 'http-proxy';
|
|
const proxy = httpProxy.createProxyServer({});
|
|
|
|
const server = http.createServer((req, res) => {
|
|
// Forward all requests from port 3000 to port 80
|
|
proxy.web(req, res, { target: 'http://localhost:80' });
|
|
});
|
|
|
|
server.listen(3000, () => {
|
|
console.log('Proxy server is running on port 3000 and forwarding requests to port 80');
|
|
});
|
|
|
|
|
|
/* 2024-12-30 Notes*/
|
|
// Switched to AWS certification so Parchment Users can have wildcard domains (*.parchment.page)
|
|
// AWS must now be used for all domains
|
|
// pip3 install certbot-dns-route53
|
|
// https://chatgpt.com/c/66fc4450-a570-8005-a177-1d1eb6c738e8
|