We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
新版Docker下的js如何修改打开HTTPS
const path = require('path') const dir = path.join(__dirname) process.env.NODE_ENV = 'production' process.chdir(__dirname) const currentPort = parseInt(process.env.PORT, 10) || 3000 const hostname = process.env.HOSTNAME || '0.0.0.0' let keepAliveTimeout = parseInt(process.env.KEEP_ALIVE_TIMEOUT, 10) const nextConfig = {"env":{},"eslint":{"ignoreDuringBuilds":false},"typescript":{"ignoreBuildErrors":false,"tsconfigPath":"tsconfig.json"},"distDir": process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(nextConfig) require('next') const { startServer } = require('next/dist/server/lib/start-server') if ( Number.isNaN(keepAliveTimeout) || !Number.isFinite(keepAliveTimeout) || keepAliveTimeout < 0 ) { keepAliveTimeout = undefined } startServer({ dir, isDev: false, config: nextConfig, hostname, port: currentPort, allowRetry: false, keepAliveTimeout, }).catch((err) => { console.error(err); process.exit(1); });
syncmeta旧版server.js的修改正常使用HTTPS
const https = require('https'); const fs = require('fs'); const options = { key: fs.readFileSync('server.key'), cert: fs.readFileSync('server.crt') };
然后修改这一行: 原来是这样:const server = http.createServer(async (req, res) => { 修改成:const server = https.createServer(options, async (req, res) => { 新版本的JS修改无效,请问如何解决
const server = http.createServer(async (req, res) => {
const server = https.createServer(options, async (req, res) => {
No response
The text was updated successfully, but these errors were encountered:
我觉得,您可以保留原来的https服务,作为一个网关负责流量转发
Sorry, something went wrong.
Bot detected the issue body's language is not English, translate it automatically.
I think you can keep the original https service and use it as a gateway responsible for traffic forwarding
No branches or pull requests
Problem Description
新版Docker下的js如何修改打开HTTPS
Solution Description
syncmeta旧版server.js的修改正常使用HTTPS
然后修改这一行:
原来是这样:
const server = http.createServer(async (req, res) => {
修改成:
const server = https.createServer(options, async (req, res) => {
新版本的JS修改无效,请问如何解决
Alternatives Considered
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: