小编Man*_*ute的帖子

尝试使用带有自定义 conf.d 的 docker-compose 运行 nginx 时出错

我正在尝试设置一个包含多个容器的 Web 服务器 - 但从我的反向代理的简单设置开始。

的 docker-compose.yml如下所示:

version: '3'

services:
    reverse-proxy:
        container_name: reverse-proxy
        hostname: reverse-proxy
        image: nginx:latest
        ports:
        - 80:80
        volumes:
        - ./nginx-config/conf.d:/etc/nginx/conf.d
        - ./html:/usr/share/nginx/html
        environment:
            - NGINX_PORT=80
            - ENV=development
Run Code Online (Sandbox Code Playgroud)

具有nginx-config文件夹结构,如:

nginx-config
|- templates
  |-default.conf.template
  |- sites-available
    |- mysite.conf.template
Run Code Online (Sandbox Code Playgroud)

default.conf.template看起来像:

server {
    listen       ${NGINX_PORT} default_server;
    listen  [::]:${NGINX_PORT} default_server;
    
    server_name  _;
    root   /usr/share/nginx/html;

    charset UTF-8;

    error_page 404 /notfound.html;
    location = /notfound.html {
        allow   all;
    }
    location / {
        return 404;
    }

    access_log off;
    log_not_found off; …
Run Code Online (Sandbox Code Playgroud)

nginx docker docker-compose nginx-config

6
推荐指数
1
解决办法
2万
查看次数

使用RestKit 0.20进行核心数据初始化

我正在尝试更新我使用Restkit 0.1到0.20的现有应用程序,但在设置核心数据堆栈时遇到一些问题,因为它遇到异常.

我的AppDelegate上有以下代码:

     /*
     Complete Core Data stack initialization
     */
    NSError *error = nil;
    NSURL *modelURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"AppModel" ofType:@"momd"]];
    // NOTE: Due to an iOS 5 bug, the managed object model returned is immutable.
    NSManagedObjectModel *managedObjectModel = [[[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL] mutableCopy];
    RKManagedObjectStore *managedObjectStore = [[RKManagedObjectStore alloc] initWithManagedObjectModel:managedObjectModel];
    [managedObjectStore createPersistentStoreCoordinator];
    NSString *storePath = [RKApplicationDataDirectory() stringByAppendingPathComponent:@"TSI.sqlite"];
    NSString *seedPath = [[NSBundle mainBundle] pathForResource:@"RKSeedDatabase" ofType:@"sqlite"];
    //NSPersistentStore __unused *persistentStore = [managedObjectStore addInMemoryPersistentStore:&error];
    NSPersistentStore *persistentStore = [managedObjectStore addSQLitePersistentStoreAtPath:storePath fromSeedDatabaseAtPath:seedPath withConfiguration:nil options:nil error:&error];
    NSAssert(persistentStore, …
Run Code Online (Sandbox Code Playgroud)

core-data objective-c ios restkit restkit-0.20

3
推荐指数
1
解决办法
2042
查看次数