LEMP顶部的蒸气

问题描述 投票:1回答:1

我在Digital Ocean上托管了这台运行LEMP的服务器。我使用它有两个原因:

  1. 我的个人网站-常规网页,例如index.html
  2. 我的游戏(应用)后端使用PHP,而PHPMyAdmin带有SQL表和一些json文件。

我想迁移到Vapor。但是我对它的工作方式有疑问。

  1. 当前服务器已经支持https,并且我不想更改它。如果我停止服务器,则所有用户都将处于黑暗中。
  2. 我需要旧的系统(php)来在测试和开发蒸气应用程序时保持正常运行和工作,即使蒸气应用程序在与PHP后端不同的目录中运行。 -不断寻找php文件的请求必须继续起作用。

较旧且正在运行的PHP版本

用户通常正在访问:example.com/news_service.php

新蒸气版本

我想创建一个类似的“获取”地址:example.com/news/service

问题:

有人知道是否可以通过安装Swift和Vapor来破坏旧系统?我是否需要再花些时间来构建这个新系统?是否可以将所有请求重定向到某个文件夹,而其他所有文件都在LEMP上运行时,只有该文件夹将运行Vapor应用程序(获取请求)?

php swift nginx vapor
1个回答
1
投票

感谢I --marc I指出“服务器块”,我可以转到

$ cd / etc / nginx / sites-available

并添加您要使用的地址-以我为例[[/ iOSService /

到该路径的任何请求都将由运行在端口8080上的Vapor Server处理

location /iOSService/ { proxy_ignore_client_abort on; proxy_pass http://localhost:8080/; proxy_redirect off; }

此外,如果您希望phpmyadmin继续工作,请确保将这些行放在此处:

# Phpmyadmin Configurations location /phpmyadmin { root /usr/share/; index index.php index.html index.htm; location ~ ^/phpmyadmin/(.+\.php)$ { try_files $uri =404; root /usr/share/; fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/; } } location /phpMyAdmin { rewrite ^/* /phpmyadmin last; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; } # PHPmyadmin configurations ends

最后,要继续提供文件,请不要忘记:

location / { try_files $uri $uri/ =404; }

© www.soinside.com 2019 - 2024. All rights reserved.