nginx

nginx

We’re going to use nginx as a reverse proxy. Virtual hosting will be established by rewrite rules. You need two bits of information: 1) the hostname you want to use (for which DNS records should already be set up); 2) the id of the Plone site you created.

We’ll set up nginx by adding a new configuration file:

sudo vi /etc/nginx/sites-available/plone5.conf

Add the contents

server {
  server_name www.yourhostname.com;
  listen 80;

  location / {
    rewrite ^/(.*)$ /VirtualHostBase/http/www.yourhostname.com:80/Plone/VirtualHostRoot/$1 break;
    proxy_pass http://localhost:8080;
  }
  location ~* manage_ {
    deny all;
  }
}

server {
  server_name yourhostname.com;
  listen 80;
  access_log off;
  rewrite ^(/.*)$  http://www.yourhostname.com$1 permanent;
}

And save.

新增留言

填寫下列表單後,就可以新增留言。網址會被轉換成可點選的連結。