我在我的角度应用程序中使用路由来加载URL。当我从应用程序内部单击链接时,此方法非常有效,但是当我尝试直接转到应用程序URL时,服务器返回404。
这是我的代码:
myApp.config(function ($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider
.when('/booking', {
templateUrl: 'wp-content/themes/myapp/pages/begin.html',
controller: 'mainController'
})
.otherwise({
redirectTo: "/"
});
});
Run Code Online (Sandbox Code Playgroud)
我的标题<base href="/myapp/">位于head标签的顶部。
我已经读到这是一个Apache重写问题,因此我尝试修改.htaccess使其包含以下内容:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /myapp/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /myapp/index.php [L]
</IfModule>
Run Code Online (Sandbox Code Playgroud)
但是,除了重定向到404页面外,这似乎没有什么不同。我正在使用WAMP和localhost。
如何使刷新应用程序或直接链接到页面有效?
我使用的建议,从这个帖子来实现多克的秘密,这样我可以使用本地SSH密钥验证用户访问Github上我的容器。我在MacOS上,没有使用Docker swarm。这是我的设置:
docker-compose.yml
version: '3.1'
services:
[servicename]:
secrets:
- ssh_private_key
[...]
secrets:
ssh_private_key:
file: ~/.ssh/id_rsa
Run Code Online (Sandbox Code Playgroud)
Docker文件
FROM python:3.7 as intermediate
RUN mkdir /root/.ssh/
RUN ln -s /run/secrets/ssh_private_key /root/.ssh/id_rsa
RUN touch /root/.ssh/known_hosts
RUN ssh-keyscan github.com >> /root/.ssh/known_hosts
COPY requirements_private_repos.txt ./
RUN pip install --no-cache-dir -r requirements_private_repos.txt
Run Code Online (Sandbox Code Playgroud)
当我尝试运行docker-compose build并使用SSH密钥从专用远程存储库中提取信息时,出现以下错误:
Permission denied (publickey).
fatal: Could not read from remote repository.
Run Code Online (Sandbox Code Playgroud)
我能够远程访问docker映像,并看到正在创建并填充秘密/run/secrets/ssh_private_key。
在Dockerfile中使用链接时,为什么链接不起作用?如果Docker机密不是正确的方法,是否有更好的方法可以将SSH密钥从MacOS共享到Docker?