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;
$data = $request->all();
$data['eid'] = $eid;
$item = Item::create($request->all());
$data['eid'] = "".$eid;
$item = Item::create($data);
return response()->json($item, 201);
}

View file

@ -26,6 +26,6 @@ class Item extends Model
*
* @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"
volumes:
- ./:/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:
WEB_DOCUMENT_ROOT: /app/public
XDEBUG_REMOTE_HOST: marvin
@ -28,7 +31,7 @@ services:
- backend
restart: on-failure
ports:
- "${DB_PORT}:3306"
- "3306:3306"
volumes:
- ./.local/db:/var/lib/mysql
- ./container/db/:/docker-entrypoint-initdb.d