# 如何通过 URL 访问插件路径？

**URL:** https://meta.discourse.org/t/how-to-access-plugin-paths-via-url/107525
**Category:** Development
**Created:** [2019年一月25日 15:05 UTC](https://meta.discourse.org/t/how-to-access-plugin-paths-via-url/107525 "2019-01-25T15:05:34Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Pilvinen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pilvinen/32/129960_2.png) [@Pilvinen](https://meta.discourse.org/u/Pilvinen)
#### Post date: [2019年一月25日 15:05 UTC](https://meta.discourse.org/t/how-to-access-plugin-paths-via-url/107525/1 "2019-01-25T15:05:34Z")

</div>

I’m trying to set up a web hook and I need to point the payload to a local file.

The file inside the Docker container is located at:  
/var/www/discourse/plugins/distodis/docroot/

To what address does this translate to as URL?

[discourse.mydomain.com/](http://discourse.mydomain.com/)???

I’ve pretty much tried everything I can think of and I’m getting 404 from all my pings.

Any ideas?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2019年一月25日 16:00 UTC](https://meta.discourse.org/t/how-to-access-plugin-paths-via-url/107525/2 "2019-01-25T16:00:06Z")

</div>

A file that lives in

`/var/www/discourse/plugins/plugin-name/public/folder/a.txt`

will be in the URL at

`https://discourse.example.com/plugins/plugin-name/folder/a.txt`

---

<div class="post-metadata">

### Author: ![Pilvinen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pilvinen/32/129960_2.png) [@Pilvinen](https://meta.discourse.org/u/Pilvinen)
#### Post date: [2019年一月25日 16:04 UTC](https://meta.discourse.org/t/how-to-access-plugin-paths-via-url/107525/3 "2019-01-25T16:04:01Z")

</div>

> [@Falco](#):
>
> will be in the URL at
> 
> `https://discourse.example.com/plugins/plugin-name/folder/a.txt`

 ![image](https://global.discourse-cdn.com/meta/original/3X/0/6/0684b9232d0b6fa8709eeddbd3f7cfeba7df60ce.png)

I can access it if I link it here `ln -s /var/www/discourse/plugins/distodis/`

But then you can download all the PHP files with secrets. They don’t get executed and the webhook is returning 405 when I ping it.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2019年一月25日 16:37 UTC](https://meta.discourse.org/t/how-to-access-plugin-paths-via-url/107525/4 "2019-01-25T16:37:45Z")

</div>

> [@Pilvinen](#):
>
> But then you can download all the PHP files with secrets.

What does PHP have to do with Discourse?

---

<div class="post-metadata">

### Author: ![Pilvinen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pilvinen/32/129960_2.png) [@Pilvinen](https://meta.discourse.org/u/Pilvinen)
#### Post date: [2019年一月25日 16:41 UTC](https://meta.discourse.org/t/how-to-access-plugin-paths-via-url/107525/5 "2019-01-25T16:41:57Z")

</div>

> [@Falco](#):
>
> What does PHP have to do with Discourse?

Nothing directly, but this plugin is using PHP:  
[https://github.com/ellotheth/distodis](https://github.com/ellotheth/distodis)

But now that I think about it … it might require an external web server, because Discourse doesn’t come with PHP support in nginx, right? 🤔

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [2019年一月25日 16:42 UTC](https://meta.discourse.org/t/how-to-access-plugin-paths-via-url/107525/6 "2019-01-25T16:42:45Z")

</div>

That’s definitely **not** a Discourse plugin.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2019年一月25日 16:44 UTC](https://meta.discourse.org/t/how-to-access-plugin-paths-via-url/107525/7 "2019-01-25T16:44:19Z")

</div>

Posting from Discourse to Discord in natively supported in this plugin:

> [@Set up Discord notifications with the discourse-chat-integration plugin](https://meta.discourse.org/t/set-up-discord-notifications-using-the-discourse-chat-integration-plugin/66600):
>
> bookmark This guide explains how to configure Discord notifications for your Discourse forum using the discourse-chat-integration plugin. This plugin is included with Discourse — no separate installation is required. person_raising_hand Required user level: Administrator Set up Discord webhook Log into your Discord server Click your server name and choose “Server Settings” Click Integrations, then Webhooks. Then click Create Webhook Choose a bot name, icon…

---

<div class="post-metadata">

### Author: ![Pilvinen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pilvinen/32/129960_2.png) [@Pilvinen](https://meta.discourse.org/u/Pilvinen)
#### Post date: [2019年一月25日 16:44 UTC](https://meta.discourse.org/t/how-to-access-plugin-paths-via-url/107525/8 "2019-01-25T16:44:26Z")

</div>

> [@zogstrip](#):
>
> That’s definitely **not** a Discourse plugin.

What? How so?

I found it here:

> [@(Another) Discourse to Discord webhook](https://meta.discourse.org/t/another-discourse-to-discord-webhook/61178):
>
> [https://github.com/ellotheth/distodis](https://github.com/ellotheth/distodis) I somehow managed to overlook [this one](https://meta.discourse.org/t/discourse-to-discord-webhook) until mine was done. The more the merrier?!

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [2019年一月25日 16:46 UTC](https://meta.discourse.org/t/how-to-access-plugin-paths-via-url/107525/9 "2019-01-25T16:46:07Z")

</div>

它在 #Customization > Extras 分类下……

> Discourse 的所有扩展和集成目录，这些扩展和集成 _不是_ Discourse 插件，例如 CMS 插件、浏览器扩展或原生应用程序。

---

<div class="post-metadata">

### Author: ![Pilvinen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pilvinen/32/129960_2.png) [@Pilvinen](https://meta.discourse.org/u/Pilvinen)
#### Post date: [2019年一月25日 16:46 UTC](https://meta.discourse.org/t/how-to-access-plugin-paths-via-url/107525/10 "2019-01-25T16:46:43Z")

</div>

> [@Falco](#):
>
> Posting from Discourse to Discord in natively supported in this plugin:

Hey, thanks a lot. I didn’t see that when I was searching for Discourse/Discord integration plugins. I’m gonna try that out!

---

<div class="post-metadata">

### Author: ![Pilvinen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pilvinen/32/129960_2.png) [@Pilvinen](https://meta.discourse.org/u/Pilvinen)
#### Post date: [2019年一月25日 17:01 UTC](https://meta.discourse.org/t/how-to-access-plugin-paths-via-url/107525/11 "2019-01-25T17:01:23Z")

</div>

> [@zogstrip](#):
>
> 它在 #Customization > Extras 类别下……

哦，好的。我应该更仔细地阅读。我只是默认那是针对非官方插件的。😰
