Browse Source

Merge pull request #1018 from colinin/signle-project

Signle project
pull/1050/head
yx lin 1 year ago
committed by GitHub
parent
commit
220f08a259
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 10
      apps/vue/docker/nginx/default.conf
  2. 1
      aspnet-core/services/LY.MicroService.Applications.Single/Dockerfile
  3. 2
      aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs
  4. 3
      aspnet-core/services/LY.MicroService.Applications.Single/Program.cs

10
apps/vue/docker/nginx/default.conf

@ -24,22 +24,22 @@ server {
}
location /connect/ {
proxy_pass http://auth-server:44385/;
proxy_pass http://auth-server:44385$request_uri;
proxy_set_header Host auth-server:44385;
}
location ~ /api/files/static/ {
# 当path参数存在子路径时 不能让nginx解码 / 符号
proxy_pass http://apigateway:30000;
proxy_pass http://apigateway:30000$request_uri;
}
location /api/ {
proxy_pass http://apigateway:30000/;
proxy_pass http://apigateway:30000$request_uri;
proxy_set_header Host $host;
}
location ^~/wapi/ {
proxy_pass http://www.nmc.cn/;
proxy_pass http://www.nmc.cn$request_uri;
proxy_set_header Host www.nmc.cn;
proxy_set_header Referer http://www.nmc.cn;
proxy_set_header X-Real-IP $remote_addr;
@ -48,7 +48,7 @@ server {
}
location /signalr-hubs/ {
proxy_pass http://apigateway:30000/;
proxy_pass http://apigateway:30000$request_uri;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

1
aspnet-core/services/LY.MicroService.Applications.Single/Dockerfile

@ -9,6 +9,7 @@ ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone
EXPOSE 80/tcp
VOLUME [ "./app/blobs" ]
VOLUME [ "./app/Logs" ]
VOLUME [ "./app/Modules" ]

2
aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs

@ -90,7 +90,7 @@ namespace LY.MicroService.Applications.Single;
public partial class MicroServiceApplicationsSingleModule
{
protected const string DefaultCorsPolicyName = "Default";
protected const string ApplicationName = "MicroService-Applications-Single";
public static string ApplicationName { get; set; } = "MicroService-Applications-Single";
private readonly static OneTimeRunner OneTimeRunner = new();
private void PreConfigureFeature()

3
aspnet-core/services/LY.MicroService.Applications.Single/Program.cs

@ -34,6 +34,9 @@ builder.Host.AddAppSettingsSecretsJson()
await builder.AddApplicationAsync<MicroServiceApplicationsSingleModule>(options =>
{
MicroServiceApplicationsSingleModule.ApplicationName = Environment.GetEnvironmentVariable("APPLICATION_NAME")
?? MicroServiceApplicationsSingleModule.ApplicationName;
options.ApplicationName = MicroServiceApplicationsSingleModule.ApplicationName;
// 从环境变量取用户机密配置, 适用于容器测试
options.Configuration.UserSecretsId = Environment.GetEnvironmentVariable("APPLICATION_USER_SECRETS_ID");
// 如果容器没有指定用户机密, 从项目读取

Loading…
Cancel
Save