0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Apache2.4でリバースプロキシ(https - http、wss - ws)

Posted at
a2enmod ssl
a2enmod proxy  
a2enmod proxy_http  
a2enmod proxy_wstunnel  
vi /etc/apache2/sites-available/default-ssl.conf 
<IfModule mod_ssl.c>
  <VirtualHost _default_:443>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/{ドメイン名}/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/{ドメイン名}/privkey.pem
	ProxyPass /ws ws://localhost:8000/ws nocanon
	ProxyPass / http://localhost:8000/ nocanon
	ProxyPassReverse /ws ws://localhost:8000/ws
	ProxyPassReverse / http://localhost:8000/
    <FilesMatch "\.(cgi|shtml|phtml|php)$">
        SSLOptions +StdEnvVars
    </FilesMatch>
    <Directory /usr/lib/cgi-bin>
        SSLOptions +StdEnvVars
    </Directory>
  </VirtualHost>
</IfModule>
systemctl restart apache2
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?