fix 405 error in docker

This commit is contained in:
j3d1 2019-12-17 14:10:46 +01:00
parent 08b1a62dc6
commit 083b6f1f18
7 changed files with 39 additions and 5 deletions

View file

@ -45,8 +45,8 @@ class ItemController extends Controller
{ {
$eid = Event::where('slug','=',$event)->first()->eid; $eid = Event::where('slug','=',$event)->first()->eid;
$data = $request->all(); $data = $request->all();
$data['eid'] = $eid; $data['eid'] = "".$eid;
$item = Item::create($request->all()); $item = Item::create($data);
return response()->json($item, 201); return response()->json($item, 201);
} }

View file

@ -26,6 +26,6 @@ class Item extends Model
* *
* @var array * @var array
*/ */
protected $hidden = ['created_at','updated_at', 'deleted_at', 'eid']; protected $hidden = ['created_at','updated_at', 'deleted_at', 'eid', 'cid', 'iid'];
} }

View file

@ -0,0 +1,9 @@
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains;";
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
add_header Access-Control-Allow-Origin '*';
client_max_body_size 50m;

View file

@ -0,0 +1,7 @@
rewrite '^/1/images/([0-9a-fA-F]{32})/?$' /staticimages/$1 last;
rewrite '^/1/thumbs/([0-9a-fA-F]{32})/?$' /thumbnails/$1 last;
# rewrite '^/thumbnails/([0-9a-fA-F]{32})$' /thumbnail.php?id=$1 last;
location /thumbnails/ {
try_files $uri /thumbnail.php?id=$uri;
}

View file

@ -0,0 +1,15 @@
location / {
if ($request_method = OPTIONS) {
add_header Content-Length 0;
add_header Content-Type text/plain;
add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS";
add_header Access-Control-Allow-Origin '*'; #$http_origin;
add_header Access-Control-Allow-Headers "Authorization, Content-Type";
add_header Access-Control-Allow-Credentials true;
return 200;
}
try_files $uri $uri/ /index.php?$query_string;
}

View file

@ -6,7 +6,10 @@ services:
- "80:80" - "80:80"
volumes: volumes:
- ./:/app - ./:/app
- ./container/web/:/entrypoint.d - ./container/web/init.sh:/entrypoint.d/09-init.sh
- ./container/web/location-root.conf:/opt/docker/etc/nginx/vhost.common.d/10-location-root.conf
- ./container/web/general.conf:/opt/docker/etc/nginx/vhost.common.d/10-general.conf
- ./container/web/images.conf:/opt/docker/etc/nginx/vhost.common.d/20-images.conf
environment: environment:
WEB_DOCUMENT_ROOT: /app/public WEB_DOCUMENT_ROOT: /app/public
XDEBUG_REMOTE_HOST: marvin XDEBUG_REMOTE_HOST: marvin
@ -28,7 +31,7 @@ services:
- backend - backend
restart: on-failure restart: on-failure
ports: ports:
- "${DB_PORT}:3306" - "3306:3306"
volumes: volumes:
- ./.local/db:/var/lib/mysql - ./.local/db:/var/lib/mysql
- ./container/db/:/docker-entrypoint-initdb.d - ./container/db/:/docker-entrypoint-initdb.d