小编Sch*_*hii的帖子

如何在同一域上的 Apache 旁边运行 node.js 应用程序而不使用端口

我试图在我的 ubuntu 服务器上使用带有 apache 的代理,以便在不使用端口的情况下访问我的 node.js 应用程序,但我测试过的解决方案都不起作用。

基本上,我有一个在我的域 examle.com 上运行的网站,并且想要使用像 myapp.example.com 这样的子域,或者使用像 example.com/myapp 这样的东西来访问 node.js 应用程序(在端口 3000 上运行并使用 https)

这是我当前的conf文件(不起作用):

#mainWebsite
<VirtualHost example.com:443>
  # Admin email, Server Name (domain name), and any aliases
  ServerAdmin webmaster@example.com
  ServerName  example.com
  ServerAlias www.example.com
  #Redirect
  #Directory
  <Directory "/var/www/html/example.com">
  Options Indexes FollowSymLinks
  AllowOverride All
  Require all granted
  </Directory>
  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html index.php
  DocumentRoot /var/www/html/example.com/public_html
  # Log file locations
  LogLevel warn
  ErrorLog  /var/www/html/example.com/log/error.log
  CustomLog /var/www/html/example.com/log/access.log combined …
Run Code Online (Sandbox Code Playgroud)

apache ubuntu http node.js

2
推荐指数
1
解决办法
1581
查看次数

标签 统计

apache ×1

http ×1

node.js ×1

ubuntu ×1